Skip to main content

Module pixels

Module pixels 

Source
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.