sample_to_lab#

anri.geom.sample_to_lab(v_sample, omega, wedge, chi, dty, y0)[source]#

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

Adapted from ImageD11.transform.compute_g_from_k() and ImageD11.transform.compute_grain_origins(). See Geometry for more details about our geometry.

Parameters:
  • v_sample (Array) – [3] Vector in sample coordinates

  • omega (float) – Omega motor value (degrees)

  • wedge (float) – Wedge motor value (degrees)

  • chi (float) – Chi motor value (degrees)

  • dty (float) – Base diffractometer Y translation value (same units as v_sample)

  • y0 (float) – The true value of dty when the rotation axis (untilted by wedge, chi) intersects the beam

Returns:

v_lab (jax.Array) – [3] Vector in lab coordinates

Notes

Given right-handed rotation matrices \(\matr{W}\), \(\matr{C}\), \(\matr{R}\) for wedge, chi and omega motors respectively, which all follow:

\[\matr{M} \cdot \vec{v_{\text{sample}}} = \vec{v_{\text{lab}}}\]

Then we get:

\[\vec{v_{\text{lab}}} = \left(0, \text{dty} - y_0, 0\right) + \matr{W} \cdot \matr{C} \cdot \matr{R} \cdot \vec{v_{\text{sample}}}\]