pub struct TofPatternRecord {
pub tof_us: Vec<f64>,
pub observed_y: Option<Vec<f64>>,
pub uncertainty: Option<Vec<f64>>,
pub mask: Option<Vec<bool>>,
pub background_y: Vec<f64>,
}Expand description
Owned time-of-flight powder pattern with an explicitly microsecond coordinate axis.
Fields§
§tof_us: Vec<f64>Strictly increasing time-of-flight grid in microseconds.
observed_y: Option<Vec<f64>>Optional observed intensity values.
uncertainty: Option<Vec<f64>>Optional positive one-sigma uncertainties.
mask: Option<Vec<bool>>Optional inclusion mask.
background_y: Vec<f64>Supplied fixed background, always sample-aligned.
Implementations§
Source§impl TofPatternRecord
impl TofPatternRecord
Sourcepub fn new(
tof_us: Vec<f64>,
observed_y: Option<Vec<f64>>,
uncertainty: Option<Vec<f64>>,
mask: Option<Vec<bool>>,
background_y: Option<Vec<f64>>,
) -> Result<Self, DomainError>
pub fn new( tof_us: Vec<f64>, observed_y: Option<Vec<f64>>, uncertainty: Option<Vec<f64>>, mask: Option<Vec<bool>>, background_y: Option<Vec<f64>>, ) -> Result<Self, DomainError>
Validate and own one TOF pattern without angle-domain conversion.
§Errors
Returns DomainError for non-finite, unordered, or mismatched arrays.
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Return the number of TOF samples.
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Revalidate all arrays after direct adapter-side construction.
§Errors
Returns DomainError for non-finite, unordered, or mismatched arrays.
Trait Implementations§
Source§impl Clone for TofPatternRecord
impl Clone for TofPatternRecord
Source§fn clone(&self) -> TofPatternRecord
fn clone(&self) -> TofPatternRecord
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 moreSource§impl Debug for TofPatternRecord
impl Debug for TofPatternRecord
Source§impl PartialEq for TofPatternRecord
impl PartialEq for TofPatternRecord
impl StructuralPartialEq for TofPatternRecord
Auto Trait Implementations§
impl Freeze for TofPatternRecord
impl RefUnwindSafe for TofPatternRecord
impl Send for TofPatternRecord
impl Sync for TofPatternRecord
impl Unpin for TofPatternRecord
impl UnsafeUnpin for TofPatternRecord
impl UnwindSafe for TofPatternRecord
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