detector_transforms#

anri.geom.detector_transforms(y_center, y_size, tilt_y, z_center, z_size, tilt_z, tilt_x, distance, o11, o12, o21, o22)[source]#

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

The units of pixel size and distance need to match, but you can choose what they are. In ImageD11, they are normally microns, but we don’t need to enforce it as they cancel out in the end. Adapted from ImageD11.transform.compute_xyz_lab() To use these transformations, see det_to_lab() and lab_to_det()

Parameters:
Returns:

  • det_trans (jax.Array) – [3,3] Combined transformation matrix (see Notes)

  • beam_cen_shift (jax.Array) – [3] Translation vector to beam center

  • x_distance_shift (jax.Array) – [3] Translation vector to move detector along X axis

Notes

We can convert a detector value (s, f) to a vector in the lab frame:

\(\vec{v_{\text{det}}} = \left(s, f, 0\right)\)

\(\vec{v_{\text{lab}}} = \left(x_{\text{lab}}, y_{\text{lab}}, z_{\text{lab}}\right)\)

\(\vec{v_{\text{lab}}} = \matr{D_{\text{trans}}} \cdot \left(\vec{v_{\text{det}} + \vec{v_{\text{cen shift}}}}\right) + \vec{v_{\text{dist shift}}}\)

where:

\(\vec{v_{\text{cen shift}}} = \left(-z_{\text{center}}, -y_{\text{center}}, 0\right)\)

\(\vec{v_{\text{dist shift}}} = \left(\text{distance}, 0, 0\right)\)

\(\matr{D_{\text{trans}}} = \matr{R_{\text{det}}} \cdot \matr{R_{\text{c.o.b}}} \cdot \matr{R_{\text{orien}}} \cdot \matr{S_{\text{px size}}}\)

where:

\(\matr{R_{\text{det}}}\) comes from detector_rotation_matrix()

\(\matr{R_{\text{c.o.b}}} = \begin{bmatrix} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{bmatrix}\) which is a change-of-basis matrix that maps \(\left(z_{\text{det}}, y_{\text{det}}, 0\right)\) to \(\left(0_{\text{det}}, y_{\text{det}}, z_{\text{det}}\right)\)

\(\matr{R_{\text{orien}}}\) comes from detector_orientation_matrix()

\(\matr{S_{\text{px size}}} = \begin{bmatrix} z_{\text{size}} & 0 & 0 \\ 0 & y_{\text{size}} & 0 \\ 0 & 0 & 1 \end{bmatrix}\) scales the pixel units to the (y_size, z_size) units.