pub enum Background {
None,
Constant,
Linear,
Strip {
width: usize,
niterations: usize,
factor: f64,
},
Snip {
width: usize,
},
Polynomial {
degree: usize,
},
}Expand description
A selectable background theory (silx bgtheories.THEORY).
Variants§
None
No background (silx “No Background”): zero everywhere.
Constant
Constant background (silx “Constant”): min(y).
Linear
Linear background (silx “Linear”): a least-squares line fitted to the strip background of the data.
Strip
Strip filter background (silx “Strip”): see strip_background.
Fields
Snip
SNIP filter background (silx “Snip”): see snip_background.
Polynomial
Polynomial background (silx “Internal” poly theories): a least-squares
polynomial of degree fitted to the strip background of the data
(silx EstimatePolyOnStrip = True).
Implementations§
Source§impl Background
impl Background
Sourcepub fn compute(self, x: &[f64], y: &[f64]) -> Vec<f64>
pub fn compute(self, x: &[f64], y: &[f64]) -> Vec<f64>
Compute the background curve sampled at x for the data y.
x is used only by the Linear / Polynomial theories (which fit a
curve in x); the strip/snip/constant theories ignore it. Falls back to
zeros when a polynomial fit is not solvable (e.g. mismatched lengths).
Trait Implementations§
Source§impl Clone for Background
impl Clone for Background
Source§fn clone(&self) -> Background
fn clone(&self) -> Background
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 Background
Source§impl Debug for Background
impl Debug for Background
Source§impl PartialEq for Background
impl PartialEq for Background
Source§fn eq(&self, other: &Background) -> bool
fn eq(&self, other: &Background) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Background
Auto Trait Implementations§
impl Freeze for Background
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnsafeUnpin for Background
impl UnwindSafe for Background
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.