Exemplo n.º 1
0
def do_index(reciprocal_space_vectors, verbose=True):
  D = dps_core()
  D.setMaxcell(algorithm_parameters.max_cell_edge_for_dps_fft)
  D.setXyzData(reciprocal_space_vectors)
  hemisphere_shortcut(ai = D,
    characteristic_sampling = algorithm_parameters.directional_sampling_granularity,
    max_cell = algorithm_parameters.max_cell_edge_basis_choice)
  M = SelectBasisMetaprocedure(D)

  from rstbx.dps_core.lepage import iotbx_converter
  L = iotbx_converter(D.getOrientation().unit_cell().minimum_cell(),5.0)
  supergroup = L[0]

  triclinic = D.getOrientation().unit_cell()

  cb_op = supergroup['cb_op_inp_best'].c().as_double_array()[0:9]
  orient = D.getOrientation()
  orient_best = orient.change_basis(matrix.sqr(cb_op).transpose())
  constrain_orient = orient_best.constrain(supergroup['system'])
  D.setOrientation(constrain_orient)

  if verbose:
    for subgroup in L:
      print subgroup.short_digest()
    print "\ntriclinic cell=%s volume(A^3)=%.3f"%(triclinic,triclinic.volume())
    print "\nafter symmetrizing to %s:"%supergroup.reference_lookup_symbol()
    M.show_rms()
  return D,L
Exemplo n.º 2
0
def do_index(reciprocal_space_vectors, verbose=True):
    D = dps_core()
    D.setMaxcell(algorithm_parameters.max_cell_edge_for_dps_fft)
    D.setXyzData(reciprocal_space_vectors)
    hemisphere_shortcut(
        ai=D,
        characteristic_sampling=algorithm_parameters.
        directional_sampling_granularity,
        max_cell=algorithm_parameters.max_cell_edge_basis_choice)
    M = SelectBasisMetaprocedure(D)

    from rstbx.dps_core.lepage import iotbx_converter
    L = iotbx_converter(D.getOrientation().unit_cell().minimum_cell(), 5.0)
    supergroup = L[0]

    triclinic = D.getOrientation().unit_cell()

    cb_op = supergroup['cb_op_inp_best'].c().as_double_array()[0:9]
    orient = D.getOrientation()
    orient_best = orient.change_basis(matrix.sqr(cb_op).transpose())
    constrain_orient = orient_best.constrain(supergroup['system'])
    D.setOrientation(constrain_orient)

    if verbose:
        for subgroup in L:
            print subgroup.short_digest()
        print "\ntriclinic cell=%s volume(A^3)=%.3f" % (triclinic,
                                                        triclinic.volume())
        print "\nafter symmetrizing to %s:" % supergroup.reference_lookup_symbol(
        )
        M.show_rms()
    return D, L
Exemplo n.º 3
0
def index_wrapper(positions, info, pdb_object):
    from rstbx.dps_core import dps_core
    from rstbx.dps_core.sampling import HemisphereSamplerBase as HemisphereSampler
    from cctbx.uctbx import unit_cell

    uc = pdb_object.unit_cell()

    sampling = get_recommended_sampling(pdb_object, info, positions)

    raw_spot_input = flex.vec3_double()
    pixel_sz = info.D.pixel_sz
    for pos in positions:
        raw_spot_input.append((pos[0] * pixel_sz, pos[1] * pixel_sz, 0.0))

    #convert raw film to camera, using labelit coordinate convention
    camdata = flex.vec3_double()
    auxbeam = col((info.C.Ybeam, info.C.Zbeam, 0.0))
    film_2_camera = sqr((-1, 0, 0, 0, -1, 0, 0, 0, 1)).inverse()
    for x in range(len(raw_spot_input)):
        camdata.append(auxbeam + film_2_camera * col(raw_spot_input[x]))

    #convert camera to reciprocal space xyz coordinates
    xyzdata = flex.vec3_double()

    for x in range(len(camdata)):
        cam = col(camdata[x])
        auxpoint = col((cam[0], cam[1], info.C.distance))
        xyz = (auxpoint / (info.C.lambda0 * 1E10 * auxpoint.length()))
        xyz = xyz - col((0.0, 0.0, 1.0 / (info.C.lambda0 * 1E10)))
        #translate recip. origin

        xyzdata.append(xyz)

    core_ai = dps_core()
    core_ai.setXyzData(xyzdata)
    core_ai.setMaxcell(1.25 * max(uc.parameters()[0:3]))

    H = HemisphereSampler(characteristic_grid=sampling,
                          max_cell=1.25 * max(uc.parameters()[0:3]))
    H.hemisphere(core_ai, size=30,
                 cutoff_divisor=4.)  # never change these parameters

    from rstbx.dps_core.basis_choice import SelectBasisMetaprocedure as SBM
    M = SBM(core_ai)

    return core_ai, uc
def index_wrapper(positions,info,pdb_object):
  from rstbx.dps_core import dps_core
  from rstbx.dps_core.sampling import HemisphereSamplerBase as HemisphereSampler
  from cctbx.uctbx import unit_cell

  uc = pdb_object.unit_cell()

  sampling = get_recommended_sampling(pdb_object, info, positions)

  raw_spot_input = flex.vec3_double()
  pixel_sz = info.D.pixel_sz
  for pos in positions:
    raw_spot_input.append((pos[0]*pixel_sz, pos[1]*pixel_sz, 0.0))

  #convert raw film to camera, using labelit coordinate convention
  camdata = flex.vec3_double()
  auxbeam = col((info.C.Ybeam,info.C.Zbeam,0.0));
  film_2_camera = sqr((-1,0,0,0,-1,0,0,0,1)).inverse();
  for x in xrange(len(raw_spot_input)):
    camdata.append( auxbeam + film_2_camera * col(raw_spot_input[x]) )

  #convert camera to reciprocal space xyz coordinates
  xyzdata = flex.vec3_double()

  for x in xrange(len(camdata)):
    cam = col(camdata[x])
    auxpoint = col((cam[0],cam[1],info.C.distance));
    xyz = ( auxpoint / (info.C.lambda0*1E10 * auxpoint.length()) );
    xyz = xyz - col((0.0, 0.0, 1.0/(info.C.lambda0*1E10))); #translate recip. origin

    xyzdata.append( xyz );

  core_ai = dps_core()
  core_ai.setXyzData(xyzdata)
  core_ai.setMaxcell(1.25*max(uc.parameters()[0:3]))

  H = HemisphereSampler(
      characteristic_grid = sampling,
      max_cell=1.25*max(uc.parameters()[0:3]))
  H.hemisphere(core_ai,size=30,cutoff_divisor=4.) # never change these parameters

  from rstbx.dps_core.basis_choice import SelectBasisMetaprocedure as SBM
  M = SBM(core_ai)

  return core_ai,uc