pub struct TofScale {
pub tof_min: i32,
pub tof_max: i32,
pub tof_step: i32,
pub edges: Vec<f32>,
pub centers: Vec<f32>,
}Fields§
§tof_min: i32Smallest TOF index we include in the grid (inclusive).
tof_max: i32Largest TOF index we include in the grid (inclusive).
tof_step: i32Step between bins in TOF units (usually 1, 2, 4, …).
edges: Vec<f32>Bin edges and centers in TOF space.
centers: Vec<f32>Implementations§
Source§impl TofScale
impl TofScale
Sourcepub fn build_from_frames(frames: &[TimsFrame], tof_step: i32) -> Option<Self>
pub fn build_from_frames(frames: &[TimsFrame], tof_step: i32) -> Option<Self>
Build a TOF grid from a set of frames.
tof_step = 1=> 1 bin per raw TOF index (max resolution).- Larger steps downsample TOF to reduce rows.
Sourcepub fn build_from_tof(frames: &[TimsFrame], tof_step: i32) -> Option<Self>
pub fn build_from_tof(frames: &[TimsFrame], tof_step: i32) -> Option<Self>
Backwards-compatible alias if you already referenced build_from_tof.
pub fn num_bins(&self) -> usize
Sourcepub fn index_of_tof(&self, tof: i32) -> Option<usize>
pub fn index_of_tof(&self, tof: i32) -> Option<usize>
Map TOF → bin index (usize). Returns None if outside range.
Sourcepub fn index_range_for_tof_window(&self, a: i32, b: i32) -> (usize, usize)
pub fn index_range_for_tof_window(&self, a: i32, b: i32) -> (usize, usize)
Return a bin-index range for a TOF window [a, b] (inclusive, clamped).
pub fn center(&self, idx: usize) -> f32
Sourcepub fn center_at(&self, mu: f32) -> f32
pub fn center_at(&self, mu: f32) -> f32
Continuous center for a fractional TOF-bin index mu.
Used by tof_center_at on the Py side.
Sourcepub fn tof_bounds_for_row(&self, r: usize) -> (f32, f32)
pub fn tof_bounds_for_row(&self, r: usize) -> (f32, f32)
Optional helper: get TOF edges (for debug / plotting).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TofScale
impl RefUnwindSafe for TofScale
impl Send for TofScale
impl Sync for TofScale
impl Unpin for TofScale
impl UnwindSafe for TofScale
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.