Skip to main content

nereids_pipeline/
lib.rs

1//! # nereids-pipeline
2//!
3//! End-to-end orchestration for neutron resonance imaging analysis.
4//!
5//! This crate ties together all NEREIDS components into a complete pipeline:
6//! data loading → normalization → forward model → fitting → spatial mapping.
7//!
8//! ## Modules
9//! - [`beam`] — The beam before the sample, per µs of flight time
10//! - [`calibration`] — Energy calibration for TOF neutron instruments (t0 + flight-path scale)
11//! - [`counts_fit`] — Densities, temperature, normalization and background fitted to the
12//!   open-beam and sample counts (fit_counts)
13//! - [`detectability`] — Trace-detectability analysis (pre-experiment SNR check)
14//! - [`error`] — Pipeline error types
15//! - [`open_beam`] — The beam fitted to the open-beam counts (fit_open_beam)
16//! - [`pipeline`] — Single-spectrum analysis pipeline (fit_spectrum_typed)
17//! - [`spatial`] — Per-pixel parallel mapping with rayon (spatial_map_typed)
18
19pub mod beam;
20pub mod calibration;
21pub mod counts_fit;
22pub mod detectability;
23pub mod error;
24pub mod joint_fit;
25pub mod open_beam;
26pub mod pipeline;
27/// Expected detector counts from the counts measurement equation, for tests.
28#[cfg(feature = "test-support")]
29pub mod reference;
30pub mod spatial;
31/// Synthetic counts-domain measurements with known ground truth, for tests.
32///
33/// Gated on the `test-support` feature ALONE, not on `cfg(test)` as well.
34/// `cfg(test)` does not enable the feature, so the unit-test target would
35/// compile this module while its optional `rand_chacha` dependency stayed
36/// off — it happens to build today only because the self dev-dependency
37/// unifies the feature across the package, which is not something to rely
38/// on. Never built into a release.
39#[cfg(feature = "test-support")]
40pub mod synthetic;