Detector calibration

Purpose. Detector pixels must be mapped to scattering vector q before integrated curves are physically meaningful. A calibrant (typically silver behenate, AgBh) produces known Bragg rings; geometry is refined so that those rings sit at the correct radii for the stated wavelength.

What autosaxs does (custom). Calibration does not start from a hand-picked beam center. The custom ring pipeline:

  1. Smooths / prepares the calibrant image and finds ring-like sources (log-smoothed Laplacian response → clustering of candidate points → circle fits per ring group).
  2. Estimates an initial sample–detector distance from the innermost detected ring radius and the calibrant’s smallest theoretical 2θ at the given wavelength.
  3. Applies the chosen mask mode (from file / auto beam-stop / combined).
  4. Hands the geometry guess to pyFAI for final refinement (refine3) and writes a reusable integrator under calibration/.

What you should set. Wavelength (Å), calibrant name, and a sensible mask. Distance guess is optional — the ring-based estimate usually suffices. A bad mask or wrong wavelength will refine to a plausible-looking but wrong q scale.

Engines. Custom ring finding + pyFAI geometry refinement.