get_centroid_scan_all_grains_both#

anri.fwd.get_centroid_scan_all_grains_both(ubi, origin_sample, hkl, wavelength, k_in_lab, ky, kz, wedge, chi, y0, s_step_lab, f_step_lab, det_origin_lab)#

Vectorized version of get_centroid_scan_both. Takes similar arguments as get_centroid_scan_both but with additional array axes over which get_centroid_scan_both is mapped.

Original documentation:

Forward project (ubi, hkl) to both Friedel 4D peak centroids in the Scanning 3DXRD case.

This can be vectorised over ubis and origin_samples, see get_centroid_scan_all_grains_both(). It can then be vectorised in an outer loop over hkl, see get_centroid_scan_all_both().

Parameters:
  • ubi (Array) – [3,3] (U.B)^(-1) matrix of the grain/voxel

  • origin_sample (Array) – [3] origin position of the voxel in the sample reference frame

  • hkl (Array) – [3] (h,k,l) reciprocal space vector

  • wavelength (float) – Wavelength in angstroms

  • k_in_lab (Array) – [3] Direction of the incoming beam before divergence, lab frame (any length, not vertical)

  • ky (float) – Horizontal beam divergence: small tilt of the beam (radians) along the horizontal across it, see anri.geom.beam_basis(). Usually zero.

  • kz (float) – Vertical beam divergence: small tilt of the beam (radians) along the vertical across it, see anri.geom.beam_basis(). Usually zero.

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

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

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

  • s_step_lab (Array) – [3] Lab-frame step of one pixel along the slow direction, from anri.geom.detector_basis_vectors_lab().

  • f_step_lab (Array) – [3] Lab-frame step of one pixel along the fast direction, from anri.geom.detector_basis_vectors_lab().

  • det_origin_lab (Array) – [3] Lab-frame position of pixel (0, 0), from anri.geom.detector_basis_vectors_lab().

Returns:

  • centroids (jax.Array) – [2,4] Peak centres of mass in (sc, fc, omega, dty). Index 0 is the etasign = +1 solution, index 1 is etasign = -1.

  • valid (jax.Array) – Boolean indicating if a valid solution exists, shared by both branches

Notes

There is no etasign argument. Both solutions come from one call to anri.fwd.hkl_to_k_omega_both(), which evaluates the geometry shared between the branches once. Only ray-tracing to the detector, and the dty that follows from each omega, are done per branch.

See also

get_centroid_scan

Single-solution version, taking an etasign argument.