pub struct XrdPattern {
pub two_theta: Vec<f64>,
pub intensity: Vec<f64>,
}Expand description
Parsed X-ray diffraction pattern.
Fields§
§two_theta: Vec<f64>2θ angles in degrees.
intensity: Vec<f64>Intensity values (arbitrary units).
Implementations§
Source§impl XrdPattern
impl XrdPattern
Sourcepub fn new(two_theta: Vec<f64>, intensity: Vec<f64>) -> Self
pub fn new(two_theta: Vec<f64>, intensity: Vec<f64>) -> Self
Create an XRD pattern from parallel 2θ and intensity arrays.
Sourcepub fn find_peaks(&self) -> Vec<usize>
pub fn find_peaks(&self) -> Vec<usize>
Find peak positions (local maxima) using a simple derivative method.
Returns indices into two_theta/intensity where peaks occur.
Sourcepub fn d_spacings(&self) -> Vec<f64>
pub fn d_spacings(&self) -> Vec<f64>
Convert 2θ peak positions to d-spacings using Bragg’s law: d = λ/(2 sin θ).
Uses Cu Kα radiation (λ = 1.5406 Å) by default.
Trait Implementations§
Source§impl Clone for XrdPattern
impl Clone for XrdPattern
Source§fn clone(&self) -> XrdPattern
fn clone(&self) -> XrdPattern
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 XrdPattern
impl RefUnwindSafe for XrdPattern
impl Send for XrdPattern
impl Sync for XrdPattern
impl Unpin for XrdPattern
impl UnsafeUnpin for XrdPattern
impl UnwindSafe for XrdPattern
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.