Expand description
Spectrum file parser for TOF/energy bin edges or centers.
Parses CSV/TXT files containing TOF or energy values that define the spectral bins of a neutron imaging dataset.
§Supported formats
- Single-column: one value per line
- Two-column (CSV/TSV): first column used, rest ignored
- Comment lines starting with
#are skipped - First non-comment line skipped if it cannot be parsed as a number (header)
Enums§
- Spectrum
Unit - Whether spectrum values represent TOF or energy.
- Spectrum
Value Kind - Whether values are bin edges (N+1 for N bins) or bin centers (N for N bins).
Functions§
- parse_
spectrum_ file - Parse a spectrum file from disk.
- parse_
spectrum_ text - Parse spectrum values from a string.
- validate_
monotonic - Validate that values are strictly monotonically increasing.
- validate_
spectrum_ frame_ count - Validate that spectrum values are compatible with the TIFF frame count.