Skip to main content

CalibrationConfig

Struct CalibrationConfig 

Source
pub struct CalibrationConfig {
Show 15 fields pub flight_path_m: f64, pub fit_background: bool, pub restarts: usize, pub xatol: f64, pub fatol: f64, pub max_iter: usize, pub ic_n_energies: usize, pub ic_n_tau: usize, pub psr_fwhm_ns: f64, pub fit_t0: bool, pub fit_l_scale: bool, pub position_t0_center_us: f64, pub position_l_scale_center: f64, pub position_t0_prior_us: Option<f64>, pub position_l_scale_prior: Option<f64>,
}
Expand description

Configuration for calibrate_resolution.

Fields§

§flight_path_m: f64

Flight-path length (m).

§fit_background: bool

Fit a low-order baseline (anorm + constant + linear) instead of anorm only.

§restarts: usize

Number of optimizer restarts (perturbed starts; keep the best).

§xatol: f64

Nelder–Mead simplex-spread tolerance.

§fatol: f64

Nelder–Mead objective-range tolerance.

§max_iter: usize

Nelder–Mead maximum iterations.

§ic_n_energies: usize

IC synthesis grid resolution (energies × τ-samples per kernel).

§ic_n_tau: usize§psr_fwhm_ns: f64

SNS PSR (accumulator-ring) channel-triangle FWHM in ns, folded into the IC family only (default DEFAULT_PSR_FWHM_NS; 0.0 disables the fold). Tabulated/UDR (FTS) kernels already carry the fold in the file itself (header: “folded triang FWHM 350 ns PSR”) and are structurally never re-folded here — applying it twice would double-count the burst. When the family is IkedaCarpenter { fit_psr: true } this value is the fit’s starting point instead of a pin, clamped into the 0.05–1 µs fit box: a width in (1, 10] µs is a legal pin but an out-of-box start — the fit then starts at the box top (announced by a stderr warning), and if it stays there it reports psr_fwhm_us:upper in CalibrationResult::bounds_hit. Nonzero widths above PSR_FWHM_PIN_CEILING_US (10 µs = 10 000 ns) are rejected as a ns↔µs unit slip — see that constant for the quadratic-cost rationale.

§fit_t0: bool

Fit the SAMMY TOF-zero t0 (µs) as a SHARED energy-scale parameter. Default false — position is pinned at position_t0_center_us so calibration is a pure shape/width fit (matching SAMMY, where t0/L are a separate energy-scale calibration). Opt in only with a metrology prior; see with_position_prior.

§fit_l_scale: bool

Fit the flight-path scale L_scale as a shared energy-scale parameter. Default false. A free L_scale shares the asymmetric-kernel lag’s 1/√E basis and corrupts the calibrated width — fit it only under a prior.

§position_t0_center_us: f64

Prior mean (and pinned value when fit_t0 is false) of the TOF zero t0 (µs). Default 0.0. Lets a caller inject a pre-calibrated t0.

§position_l_scale_center: f64

Prior mean (and pinned value when fit_l_scale is false) of L_scale. Default 1.0.

§position_t0_prior_us: Option<f64>

Gaussian prior σ on t0 (µs); None = flat (bounded only). When set, adds ((t0 − center)/σ)² to the data χ² (a metrology penalty, not part of the reported chi2_dof).

§position_l_scale_prior: Option<f64>

Gaussian prior σ on L_scale; None = flat. See position_t0_prior_us.

Implementations§

Source§

impl CalibrationConfig

Source

pub fn with_position_prior( self, t0_center_us: f64, l_scale_center: f64, sigma_t0_us: f64, sigma_l_scale: f64, ) -> Self

Enable a SHARED, metrology-priored energy-scale (t0, L_scale) fit: sets fit_t0/fit_l_scale, the prior means (*_center), and the Gaussian prior σ. Use this for joint energy-scale or cross-family identifiability work; the default config pins position (pure shape/width calibration). Pass the prior σ from the instrument’s independent flight-path / timing metrology — a loose σ marginalizes position (weak, honest shape-only discrimination), a tight σ pins it.

Trait Implementations§

Source§

impl Clone for CalibrationConfig

Source§

fn clone(&self) -> CalibrationConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CalibrationConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CalibrationConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more