def raw_spot_positions_mm_to_S1_vector( raw_spot_input, # as vec3_double detector, inverse_wave, panelID=None ): if panelID is None: panelID = flex.int(len(raw_spot_input),0) reciprocal_space_vectors = flex.vec3_double() # tile surface to laboratory transformation for n in xrange(len(raw_spot_input)): pid = panelID[n] lab_direct = col(detector[pid].get_lab_coord(raw_spot_input[n][0:2])) # laboratory direct to reciprocal space xyz transformation lab_recip = (lab_direct.normalize() * inverse_wave) reciprocal_space_vectors.append ( lab_recip ) return reciprocal_space_vectors
def raw_spot_positions_mm_to_reciprocal_space( raw_spot_input, # as vec3_double detector, inverse_wave, beam, axis, # beam, axis as scitbx.matrix.col panelID=None): if panelID is None: panelID = flex.int(len(raw_spot_input), 0) if axis is None: return raw_spot_positions_mm_to_reciprocal_space_xyz( raw_spot_input, detector, inverse_wave, beam, panelID) else: return raw_spot_positions_mm_to_reciprocal_space_xyz( raw_spot_input, detector, inverse_wave, beam, axis, panelID) """Assumptions: 1) the raw_spot_input is in the same units of measure as the origin vector (mm). they are given in physical length, not pixel units 2) the raw_spot centers of mass are given with the same corner/center convention as the origin vector. E.g., spotfinder assumes that the mm scale starts in the middle of the lower-corner pixel. """ reciprocal_space_vectors = flex.vec3_double() # tile surface to laboratory transformation for n in range(len(raw_spot_input)): pid = panelID[n] lab_direct = col(detector[pid].get_lab_coord( raw_spot_input[n][0:2])) # laboratory direct to reciprocal space xyz transformation lab_recip = (lab_direct.normalize() * inverse_wave) - beam reciprocal_space_vectors.append( lab_recip.rotate_around_origin(axis=axis, angle=raw_spot_input[n][2], deg=True)) return reciprocal_space_vectors
def raw_spot_positions_mm_to_S1_vector( raw_spot_input, # as vec3_double detector, inverse_wave, panelID=None): if panelID is None: panelID = flex.int(len(raw_spot_input), 0) reciprocal_space_vectors = flex.vec3_double() # tile surface to laboratory transformation for n in range(len(raw_spot_input)): pid = panelID[n] lab_direct = col(detector[pid].get_lab_coord( raw_spot_input[n][0:2])) # laboratory direct to reciprocal space xyz transformation lab_recip = (lab_direct.normalize() * inverse_wave) reciprocal_space_vectors.append(lab_recip) return reciprocal_space_vectors
def raw_spot_positions_mm_to_reciprocal_space( raw_spot_input, # as vec3_double detector, inverse_wave, beam, axis, # beam, axis as scitbx.matrix.col panelID=None ): if panelID is None: panelID = flex.int(len(raw_spot_input),0) if axis is None: return raw_spot_positions_mm_to_reciprocal_space_xyz ( raw_spot_input, detector, inverse_wave, beam, panelID ) else: return raw_spot_positions_mm_to_reciprocal_space_xyz ( raw_spot_input, detector, inverse_wave, beam, axis, panelID ) """Assumptions: 1) the raw_spot_input is in the same units of measure as the origin vector (mm). they are given in physical length, not pixel units 2) the raw_spot centers of mass are given with the same corner/center convention as the origin vector. E.g., spotfinder assumes that the mm scale starts in the middle of the lower-corner pixel. """ reciprocal_space_vectors = flex.vec3_double() # tile surface to laboratory transformation for n in xrange(len(raw_spot_input)): pid = panelID[n] lab_direct = col(detector[pid].get_lab_coord(raw_spot_input[n][0:2])) # laboratory direct to reciprocal space xyz transformation lab_recip = (lab_direct.normalize() * inverse_wave) - beam reciprocal_space_vectors.append ( lab_recip.rotate_around_origin( axis=axis, angle=raw_spot_input[n][2], deg=True) ) return reciprocal_space_vectors