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: f64Flight-path length (m).
fit_background: boolFit a low-order baseline (anorm + constant + linear) instead of anorm only.
restarts: usizeNumber of optimizer restarts (perturbed starts; keep the best).
xatol: f64Nelder–Mead simplex-spread tolerance.
fatol: f64Nelder–Mead objective-range tolerance.
max_iter: usizeNelder–Mead maximum iterations.
ic_n_energies: usizeIC synthesis grid resolution (energies × τ-samples per kernel).
ic_n_tau: usize§psr_fwhm_ns: f64SNS 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: boolFit 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: boolFit 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: f64Prior 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: f64Prior 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
impl CalibrationConfig
Sourcepub fn with_position_prior(
self,
t0_center_us: f64,
l_scale_center: f64,
sigma_t0_us: f64,
sigma_l_scale: f64,
) -> Self
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
impl Clone for CalibrationConfig
Source§fn clone(&self) -> CalibrationConfig
fn clone(&self) -> CalibrationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CalibrationConfig
impl Debug for CalibrationConfig
Auto Trait Implementations§
impl Freeze for CalibrationConfig
impl RefUnwindSafe for CalibrationConfig
impl Send for CalibrationConfig
impl Sync for CalibrationConfig
impl Unpin for CalibrationConfig
impl UnsafeUnpin for CalibrationConfig
impl UnwindSafe for CalibrationConfig
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