pub struct EnergyScaleTransmissionModel { /* private fields */ }Expand description
Transmission model with energy-scale calibration parameters (t₀, L_scale).
Wraps precomputed cross-sections and re-maps the energy grid at each evaluation:
- 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)² - Interpolate cross-sections σ(E_nom) → σ(E_corr)
- Beer-Lambert + resolution on the corrected grid
This is equivalent to SAMMY’s TZERO parameters.
The Jacobian for t₀ and L_scale is computed via finite differences (the energy-grid remapping is nonlinear and not easily differentiable analytically through the interpolation + resolution pipeline).
Implementations§
Source§impl EnergyScaleTransmissionModel
impl EnergyScaleTransmissionModel
Sourcepub fn new(
cross_sections: Arc<Vec<Vec<f64>>>,
density_indices: Arc<Vec<usize>>,
nominal_energies: Vec<f64>,
flight_path_m: f64,
t0_index: usize,
l_scale_index: usize,
instrument: Option<Arc<InstrumentParams>>,
) -> Self
pub fn new( cross_sections: Arc<Vec<Vec<f64>>>, density_indices: Arc<Vec<usize>>, 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
cross_sections— Precomputed σ(E) on the nominal grid.density_indices— Maps isotope index → parameter index.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.
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>
Predict model output for the given parameter vector. Read more
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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