Expand description
Data-quality pixel masks and per-pixel spectrum extraction.
The boolean masks exclude pixels whose data stream is broken, so they are never fitted. They are not a coverage or low-count filter: low-count pixels are alive and the counts likelihood handles them.
Deadness is per acquisition, so always union the sample and open-beam
masks; detect_bad_pixels does this.
Constants§
- HOT_
LOCAL_ FACTOR - Local-neighborhood confirmation factor (stage 2) of
detect_hot_pixels. - HOT_
PIXEL_ K_ MAD - Default MAD multiplier for the global (stage-1) cut of
detect_hot_pixels.
Functions§
- average_
roi - Average spectra over a rectangular region of interest.
- detect_
bad_ pixels - Detect all pipeline-corrupting pixels: dead ∪ hot over sample and (optionally) open beam.
- detect_
dead_ pixels - Detect dead pixels (zero counts across all TOF bins of one stack).
- detect_
dead_ pixels_ chunked - Detect dead pixels across acquisition chunks (dead-in-any-chunk).
- detect_
hot_ pixels - Detect hot (railed / runaway) pixels via a two-stage criterion: a robust one-sided log-space median + k·MAD screen on per-pixel total counts (stage 1, global), confirmed by a local-neighborhood isolation test (stage 2).
- extract_
spectrum - Extract a single spectrum (all TOF bins) from a pixel in the 3D array.