geom#

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

Functions

beam_basis(k_in_lab)

Return unit vectors along a beam and across it, horizontally and vertically, in the lab frame.

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 the detector's pixel steps and pixel (0, 0) position in the laboratory frame.

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.

dty_and_origin_lab(v_sample, k_in_lab, ...)

Find the dty that brings v_sample into the beam, and the lab position it then occupies.

find_dty_for_beam_xy(v_sample, k_in_lab, ...)

Find the dty value required to make the beam intersect a specific point v_sample at a given omega.

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

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

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

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

raytrace_to_det(vec_lab, origin_lab, ...)

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

recon_positions(n, step)

Sample-frame positions of every voxel of an n x n reconstruction grid, in reconstruction order.

recon_to_step(ri, rj, recon_shape)

Convert rotation space (origin in corner) to step space (integer steps leading from rotation axis).

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).

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

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

sino_shift_and_pad(y0, ny, ymin, ystep)

Shift and padding that centre a sinogram of ny dty rows on the rotation axis, as ImageD11 does.

step_grid_from_ybincens(ybincens, step_size, ...)

Create reconstruction grid in "step" space (integer units of the step size).

step_to_recon(si, sj, recon_shape)

Convert step space (integer steps leading from rotation axis) to rotation space (origin in corner).

step_to_sample(si, sj, ystep)

Convert step space (integer steps leading from rotation axis) to sample space.