pub struct TofIncidentSpectrum {
pub min_tof_us: f64,
pub max_tof_us: f64,
pub coefficients: [f64; 12],
}Expand description
Facility-neutral Maxwellian-plus-Chebyshev TOF incident spectrum.
The twelve coefficients are P1..P12. With TOF t in milliseconds and
x = 2/t - 1, the calibrated intensity is
P1 + P2 t^-5 exp(-P3/t^2) + sum(Pj T_(j-3)(x), j=4..12).
Fields§
§min_tof_us: f64Inclusive lower validity bound in microseconds.
max_tof_us: f64Inclusive upper validity bound in microseconds.
coefficients: [f64; 12]Coefficients P1..P12 in the documented function order.
Implementations§
Source§impl TofIncidentSpectrum
impl TofIncidentSpectrum
Sourcepub fn new(
min_tof_us: f64,
max_tof_us: f64,
coefficients: [f64; 12],
) -> Result<Self, TofIncidentSpectrumError>
pub fn new( min_tof_us: f64, max_tof_us: f64, coefficients: [f64; 12], ) -> Result<Self, TofIncidentSpectrumError>
Construct and validate a fixed incident-spectrum calibration.
§Errors
Returns TofIncidentSpectrumError for an invalid range or
non-finite coefficient.
Sourcepub fn evaluate(
self,
tof_us: f64,
) -> Result<TofIncidentSpectrumPoint, TofIncidentSpectrumError>
pub fn evaluate( self, tof_us: f64, ) -> Result<TofIncidentSpectrumPoint, TofIncidentSpectrumError>
Evaluate the calibrated intensity and analytical TOF derivative.
The validity interval is inclusive at both ends.
§Errors
Returns TofIncidentSpectrumError when TOF lies outside the
calibration interval or the fitted function is not positive and finite.
Trait Implementations§
Source§impl Clone for TofIncidentSpectrum
impl Clone for TofIncidentSpectrum
Source§fn clone(&self) -> TofIncidentSpectrum
fn clone(&self) -> TofIncidentSpectrum
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TofIncidentSpectrum
Source§impl Debug for TofIncidentSpectrum
impl Debug for TofIncidentSpectrum
Source§impl PartialEq for TofIncidentSpectrum
impl PartialEq for TofIncidentSpectrum
impl StructuralPartialEq for TofIncidentSpectrum
Auto Trait Implementations§
impl Freeze for TofIncidentSpectrum
impl RefUnwindSafe for TofIncidentSpectrum
impl Send for TofIncidentSpectrum
impl Sync for TofIncidentSpectrum
impl Unpin for TofIncidentSpectrum
impl UnsafeUnpin for TofIncidentSpectrum
impl UnwindSafe for TofIncidentSpectrum
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
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> ⓘ
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> ⓘ
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