pub fn broadened_cross_sections(
energies: &[f64],
resonance_data: &[ResonanceData],
temperature_k: f64,
instrument: Option<&InstrumentParams>,
cancel: Option<&AtomicBool>,
) -> Result<Vec<Vec<f64>>, TransmissionError>Expand description
Compute Doppler-broadened cross-sections for each isotope.
Returns Doppler-only cross-sections. Resolution broadening is NOT applied here because it must be applied after Beer-Lambert on the total transmission for physically correct results (issue #442).
When instrument is Some, the auxiliary extended grid is still
constructed for Doppler boundary accuracy, but the resolution
convolution is not performed.
This is the expensive physics step that should be done once before
fitting many pixels with the same isotopes and energy grid. The result
feeds into nereids_fitting::transmission_model::PrecomputedTransmissionModel,
which currently applies Beer-Lambert only. Post-Beer-Lambert resolution
broadening per-pixel is not yet implemented (issue #442 Step 3).
§Arguments
energies— Energy grid in eV (sorted ascending).resonance_data— Resonance parameters for each isotope.temperature_k— Sample temperature for Doppler broadening.instrument— Optional instrument resolution parameters. Used only for auxiliary grid construction (Doppler boundary accuracy). Resolution broadening is NOT applied.cancel— Optional cancellation token. Cancellation is checked at the start of each isotope’s parallel task; in-flight tasks run to completion (consistent with the rayon pattern inspatial.rs).
§Returns
One cross-section vector per isotope on success.
§Errors
TransmissionError::Cancelled— if thecancelflag was observed during parallel execution (either before an isotope started or after all tasks completed).TransmissionError::Resolution— ifinstrumentisSomeandenergiesis not sorted ascending.TransmissionError::Doppler— if Doppler broadening is enabled (temperature_k > 0.0) andDopplerParamsvalidation fails (e.g., non-positive or non-finite AWR).