pleiades.processing.models_ornl module
ORNL-specific data models for neutron imaging normalization at VENUS.
This module defines data structures for the ORNL/VENUS neutron imaging processing pipeline. These models represent raw measurement data and calculated transmission spectra used in the normalization process.
The models use Pydantic v2 for validation and serialization while efficiently handling numpy arrays for numerical data.
- class pleiades.processing.models_ornl.Run(*, counts: ~numpy.ndarray, proton_charge: ~typing.Annotated[float, ~annotated_types.Gt(gt=0)], shutter_counts: ~numpy.ndarray | None = None, dead_pixel_mask: ~numpy.ndarray | None = None, metadata: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
BaseModelContainer for a single measurement run (sample or open beam).
This represents data from a single run at the VENUS beamline, containing detector counts, beam monitoring data, and metadata.
- counts
3D array of detector counts with shape (tof, y, x)
- Type:
- shutter_counts
Optional 1D array of shutter monitor counts per TOF bin
- Type:
numpy.ndarray | None
- dead_pixel_mask
Optional 2D boolean mask where True indicates dead pixels
- Type:
numpy.ndarray | None
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_shutter_shape(v: ndarray | None) ndarray | None[source]
Ensure shutter_counts is 1D if provided.
- class pleiades.processing.models_ornl.Transmission(*, energy: ~numpy.ndarray, transmission: ~numpy.ndarray, uncertainty: ~numpy.ndarray, roi: ~pleiades.processing.Roi | None = None, roi_center: ~typing.Tuple[float, float], metadata: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
BaseModelContainer for calculated transmission spectrum.
This represents the normalized transmission data ready for SAMMY fitting, containing the transmission spectrum, uncertainties, and processing metadata.
- energy
1D array of neutron energies in eV
- Type:
- transmission
1D array of transmission values (typically 0-1)
- Type:
- uncertainty
1D array of transmission uncertainties
- Type:
- roi
Optional ROI used for spatial selection
- Type:
pleiades.processing.Roi | None
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_transmission_range(v: ndarray) ndarray[source]
Warn if transmission values are outside typical range.
- classmethod validate_positive_uncertainty(v: ndarray) ndarray[source]
Ensure uncertainties are non-negative.
- model_post_init(_Transmission__context) None[source]
Validate array length consistency after initialization.
- to_dat_format() ndarray[source]
Export as 3-column array for SAMMY .dat file.
Energy values are sorted in increasing order as required by SAMMY.
- Returns:
Column 0: Energy in eV (increasing order)
Column 1: Transmission (0-1)
Column 2: Uncertainty (0-1)
- Return type:
Array with shape (n_points, 3) containing