pub fn trace_detectability(
config: &TraceDetectabilityConfig<'_>,
trace: &ResonanceData,
trace_ppm: f64,
) -> Result<TraceDetectabilityReport, PipelineError>Expand description
Compute trace-detectability for a single matrix+trace isotope pair.
Two forward_model calls (with/without trace) + argmax over the
difference spectrum. Resolution broadening is included when provided,
so the SNR reflects realistic peak spreading at VENUS.
§Arguments
config— Shared analysis parameters (matrix isotopes, energies, I₀, etc.).trace— Resonance data for the trace isotope.trace_ppm— Trace concentration in ppm by atom.
§Preconditions
config.energiesmust be non-empty and sorted ascending.config.i0must be positive (used as1/√I₀for noise estimate).config.matrix_isotopesmust be non-empty with positive densities.config.snr_thresholdmust be non-negative.trace_ppmmust be non-negative.
The Python bindings validate all of these; Rust callers are responsible for ensuring valid inputs.
§Returns
TraceDetectabilityReport with peak SNR, peak energy, detectability
flag, and the full |ΔT| spectrum.