match_tolerances#

anri.index.match_tolerances(eta, ring_j, ring_tth, ring_hw, delta, frame_step)[source]#

Compute the matching tolerances in eta and omega of predictions of grid orientations.

The truth is up to delta from the nearest grid point. To first order a rotation by delta moves a reflection by up to delta / cos(theta) (1 + tan(theta) |cot(eta)|) in eta and delta / (cos(theta) |sin(eta)|) in omega (checked numerically up to 2 degrees for |sin(eta)| > 0.3). Added: in eta, the ring’s measured half-width (anri.index.ring_widths()), seen as a displacement on the detector across the ring; in omega, half a frame. Peak widths are not added: a broad peak lights a broad region of the lit map.

Parameters:
  • eta (Array) – [Nq, Nj] predicted eta (degrees)

  • ring_j (Array) – [Nj] ring of each prediction

  • ring_tth (Array) – [Nr] 2theta and measured half-width of each ring (degrees)

  • ring_hw (Array) – [Nr] 2theta and measured half-width of each ring (degrees)

  • delta (float) – Worst-case distance from the truth to the grid (degrees)

  • frame_step (float) – Omega step of the frames (degrees)

Returns:

tol_eta, tol_omega (jax.Array) – [Nq, Nj] each, in degrees