pub struct PatternRecord {
pub x_deg: 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 observed powder pattern for one histogram.
Fields§
§x_deg: Vec<f64>Strictly increasing coordinate grid in degrees 2theta.
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 PatternRecord
impl PatternRecord
Sourcepub fn new(
x_deg: 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( x_deg: 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 pattern grid and its optional observations.
§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 samples.
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Revalidate all arrays after direct adapter-side record construction.
§Errors
Returns DomainError for non-finite, unordered, or mismatched arrays.
Trait Implementations§
Source§impl Clone for PatternRecord
impl Clone for PatternRecord
Source§fn clone(&self) -> PatternRecord
fn clone(&self) -> PatternRecord
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 PatternRecord
impl Debug for PatternRecord
Source§impl PartialEq for PatternRecord
impl PartialEq for PatternRecord
impl StructuralPartialEq for PatternRecord
Auto Trait Implementations§
impl Freeze for PatternRecord
impl RefUnwindSafe for PatternRecord
impl Send for PatternRecord
impl Sync for PatternRecord
impl Unpin for PatternRecord
impl UnsafeUnpin for PatternRecord
impl UnwindSafe for PatternRecord
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