pub struct WorkingGridLayout {
pub energies: Vec<f64>,
pub data_indices: Vec<usize>,
}Expand description
The working energy grid used for broadening, plus the map back to the data grid.
forward_model and the Beer-Lambert-aware transmission pipeline run
Doppler/Beer-Lambert/resolution on a working grid — the auxiliary
extended grid (boundary extension + resonance fine-structure) when a
Gaussian resolution function is active, otherwise the data grid itself —
and extract the data points LAST. Fitting models that cache broadened σ
for reuse across LM steps need this layout so they can reproduce the same
“broaden-on-working-grid, extract-last” ordering (issue #608): the LM fit’s
cached / precomputed paths previously collapsed σ to the coarse data grid
before resolution broadening, degrading the convolution near grid edges
and around narrow resonances relative to forward_model.
Tabulated resolution has no auxiliary grid. build_aux_grid only
extends the grid for ResolutionFunction::Gaussian; for tabulated
kernels (and when no instrument is present) energies equals the data
grid and data_indices is the identity 0..n. Callers can therefore
continue to use a data-grid crate::resolution::ResolutionPlan for
tabulated kernels — the working grid and the data grid coincide, so the
plan’s grid-identity check still passes.
Fields§
§energies: Vec<f64>Working-grid energies (eV, ascending). Equals the input data grid when no auxiliary grid was built (tabulated/no resolution).
data_indices: Vec<usize>data_indices[i] is the index of data energy i within
Self::energies. Identity (0..n) when no auxiliary grid.
Implementations§
Source§impl WorkingGridLayout
impl WorkingGridLayout
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
true when the working grid is the data grid itself (no auxiliary
extension was built). In that case Self::extract is a no-op clone.
Trait Implementations§
Source§impl Clone for WorkingGridLayout
impl Clone for WorkingGridLayout
Source§fn clone(&self) -> WorkingGridLayout
fn clone(&self) -> WorkingGridLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WorkingGridLayout
impl RefUnwindSafe for WorkingGridLayout
impl Send for WorkingGridLayout
impl Sync for WorkingGridLayout
impl Unpin for WorkingGridLayout
impl UnsafeUnpin for WorkingGridLayout
impl UnwindSafe for WorkingGridLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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