geom#

Geometry transforms to and from laboratory, detector, and sample frames.

Functions

det_to_lab(sc, fc, det_trans, ...)

Convert detector (sc, fc) coordinates to lab (lx, ly, lz) coordinates.

detector_basis_vectors_lab(det_trans, ...)

Get laboratory basis vectors for detector (slow, fast, normal).

detector_orientation_matrix(o11, o12, o21, o22)

Return a matrix that transforms detector (slow, fast) pixel values to (z_det, y_det).

detector_rotation_matrix(tilt_x, tilt_y, tilt_z)

Return a 3D orientation matrix that transforms a point in the detector reference frame to the lab frame.

detector_transforms(y_center, y_size, ...)

Return all transformations required to convert from detector pixel to lab space.

lab_to_det(xl, yl, zl, det_trans, ...)

Convert lab (lx, ly, lz) coordinates to detector (sc, fc) coordinates.

raytrace_to_det(vec_lab, origin_lab, sc_lab, ...)

Ray-trace from vector in lab frame (unknown length) to detector coordinates (sc, fc).

lab_to_sample(v_lab, omega, wedge, chi, dty, y0)

Convert from lab to sample coordinates (apply the diffractometer stack).

sample_to_lab(v_sample, omega, wedge, chi, ...)

Convert from sample to lab coordinates (apply the diffractometer stack).

rmat_from_axis_angle(axis, angle)

Return rotation matrix for positive right-handed rotation about axis by angle (degrees).

rot_x(angle)

Return rotation matrix for positive right-handed rotation about the X axis by angle (degrees).

rot_y(angle)

Return rotation matrix for positive right-handed rotation about the Y axis by angle (degrees).

rot_z(angle)

Return rotation matrix for positive right-handed rotation about the Z axis by angle (degrees).