pub struct EnergyScaleTransmissionModel { /* private fields */ }Expand description
Transmission model with energy-scale calibration parameters (t₀, L_scale).
Carries per-isotope resonance data (NOT a precomputed σ grid) and rebuilds
the TRUE cross-section at the corrected energies on each evaluation
(issue #608), matching forward_model:
- Convert nominal energy → TOF:
t = TOF_FACTOR * L / √E_nom - Apply calibration:
t_corr = t - t₀,E_corr = (TOF_FACTOR * L * L_scale / t_corr)² - Evaluate σ(E_corr) directly via
reich_moore+ Doppler on a working grid built fromE_corr(auxiliary extended grid under Gaussian resolution;E_corritself for tabulated / no resolution) — NOT interpolation of a fixed σ grid, which clamps at the auxiliary boundary and drops resonance fine-structure. - Beer-Lambert + resolution on the working grid, then extract the data points last.
This is equivalent to SAMMY’s TZERO parameters.
The Jacobian for t₀ and L_scale defaults to partial-GAL since
issue #489: central FD on t0 only (2 evals) plus an inline rank-1
derivation of the L_scale column. The previous central-FD-on-both
(4-eval) behaviour is reachable via with_jacobian_method,
NEREIDS_TZERO_JACOBIAN=fd2, or tzero_jacobian="fd2" Python kwarg.
See EnergyScaleJacobianMethod for full method documentation.
Implementations§
Source§impl EnergyScaleTransmissionModel
impl EnergyScaleTransmissionModel
Sourcepub fn new(
resonance_data: Arc<Vec<ResonanceData>>,
density_indices: Arc<Vec<usize>>,
density_ratios: Arc<Vec<f64>>,
temperature_k: f64,
nominal_energies: Vec<f64>,
flight_path_m: f64,
t0_index: usize,
l_scale_index: usize,
instrument: Option<Arc<InstrumentParams>>,
) -> Self
pub fn new( resonance_data: Arc<Vec<ResonanceData>>, density_indices: Arc<Vec<usize>>, density_ratios: Arc<Vec<f64>>, temperature_k: f64, nominal_energies: Vec<f64>, flight_path_m: f64, t0_index: usize, l_scale_index: usize, instrument: Option<Arc<InstrumentParams>>, ) -> Self
Create a new energy-scale transmission model.
§Arguments
resonance_data— Resonance parameters per isotope; σ is evaluated at the corrected energies viareich_moore+ Doppler (issue #608).density_indices— Maps isotope index → density parameter index.density_ratios— Fractional ratio per isotope (1.0 when ungrouped).temperature_k— Sample temperature (K) for Doppler broadening.nominal_energies— Energy grid in eV (ascending).flight_path_m— Nominal flight path in meters.t0_index— Index of t₀ parameter.l_scale_index— Index of L_scale parameter.instrument— Optional resolution function.
Sourcepub fn with_jacobian_method(self, method: EnergyScaleJacobianMethod) -> Self
pub fn with_jacobian_method(self, method: EnergyScaleJacobianMethod) -> Self
Override the t0 / L_scale Jacobian method for this model instance.
Bypasses the NEREIDS_TZERO_JACOBIAN env var.
Trait Implementations§
Source§impl FitModel for EnergyScaleTransmissionModel
impl FitModel for EnergyScaleTransmissionModel
Source§fn analytical_jacobian(
&self,
params: &[f64],
free_param_indices: &[usize],
_y_current: &[f64],
) -> Option<FlatMatrix>
fn analytical_jacobian( &self, params: &[f64], free_param_indices: &[usize], _y_current: &[f64], ) -> Option<FlatMatrix>
Jacobian: analytical for density parameters, finite-difference for t₀ and L_scale.
Source§impl ForwardModel for EnergyScaleTransmissionModel
impl ForwardModel for EnergyScaleTransmissionModel
Source§fn predict(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
fn predict(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
Auto Trait Implementations§
impl !Freeze for EnergyScaleTransmissionModel
impl !RefUnwindSafe for EnergyScaleTransmissionModel
impl !Send for EnergyScaleTransmissionModel
impl !Sync for EnergyScaleTransmissionModel
impl Unpin for EnergyScaleTransmissionModel
impl UnsafeUnpin for EnergyScaleTransmissionModel
impl UnwindSafe for EnergyScaleTransmissionModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more