pub struct MzCalibrator {
pub timebase: f64,
pub delay: f64,
pub c0: f64,
pub b: f64,
pub c2: f64,
pub c3: f64,
pub c4: f64,
}Expand description
m/z axis calibration (Bruker “model type 1” base curve + optional cubic).
Flight time from a TOF index: t = index * timebase + delay
Calibration curve (time as fn of mass): t = C0 + b*s + c2*s^2 + c3*s^3
with s = sqrt(m + c4) and b = sqrt(1e12 / C1_tempcomp).
Coefficient meaning (columns of the MzCalibration table):
timebase=DigitizerTimebase— ns per digitizer sample.delay=DigitizerDelay— fixed time offset (samples) before t0.C0— constant term of the time/mass curve (~ the t-intercept).C1— governs the dominant sqrt term;b = sqrt(1e12 / C1).c2— quadratic termC2*s^2of the curve; used by BOTH models.c3— cubic termC3*s^3; ModelType 1 only (in ModelType 2 the C3 column is a duplicate of C0 and is dropped).c4— “reduced mass” shift m0 (x = m - m0); patent US7,851,746. Temperature compensation (T1/T2= reference temps inMzCalibration,dC1/dC2its sensitivities,T1f/T2f= per-frameFrames.T1/Frames.T2):tc = 1 + (dC1*(T1-T1f) + dC2*(T2-T2f)) / 1e6, applied asC1 *= tc.
Fields§
§timebase: f64§delay: f64§c0: f64§b: f64§c2: f64§c3: f64§c4: f64Implementations§
Source§impl MzCalibrator
impl MzCalibrator
Sourcepub fn new(
model_type: i64,
timebase: f64,
delay: f64,
t1_ref: f64,
t2_ref: f64,
dc1: f64,
dc2: f64,
c0: f64,
c1: f64,
c2: f64,
c3: f64,
c4: f64,
t1_frame: f64,
t2_frame: f64,
) -> Self
pub fn new( model_type: i64, timebase: f64, delay: f64, t1_ref: f64, t2_ref: f64, dc1: f64, dc2: f64, c0: f64, c1: f64, c2: f64, c3: f64, c4: f64, t1_frame: f64, t2_frame: f64, ) -> Self
Build a calibrator from raw MzCalibration columns + per-frame temps.
model_type selects whether the C2/C3 curve terms are honoured (type 1)
or zeroed (type 2, base curve only).
Trait Implementations§
Source§impl Clone for MzCalibrator
impl Clone for MzCalibrator
Source§fn clone(&self) -> MzCalibrator
fn clone(&self) -> MzCalibrator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MzCalibrator
impl RefUnwindSafe for MzCalibrator
impl Send for MzCalibrator
impl Sync for MzCalibrator
impl Unpin for MzCalibrator
impl UnsafeUnpin for MzCalibrator
impl UnwindSafe for MzCalibrator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.