pub struct FitWidget { /* private fields */ }Expand description
A window widget to perform curve fitting on 1D data and display the result.
Implementations§
Source§impl FitWidget
impl FitWidget
Sourcepub fn new(render_state: &RenderState, plot_id: PlotId) -> Self
pub fn new(render_state: &RenderState, plot_id: PlotId) -> Self
Create a new FitWidget with a backing Plot1D.
Sourcepub fn set_fit_range(&mut self, range: Option<(f64, f64)>)
pub fn set_fit_range(&mut self, range: Option<(f64, f64)>)
Set the fit range [xmin, xmax]; only points inside it are fitted
(silx FitWidget xmin/xmax). Pass None to fit the whole curve.
Sourcepub fn selected_choice(&self) -> FitModelChoice
pub fn selected_choice(&self) -> FitModelChoice
The currently selected fit model choice.
Sourcepub fn set_selected_choice(&mut self, choice: FitModelChoice)
pub fn set_selected_choice(&mut self, choice: FitModelChoice)
Set the selected fit model choice.
Sourcepub fn fit_background(&self) -> Background
pub fn fit_background(&self) -> Background
The background theory subtracted before an iterative peak fit (silx
FitWidget background combo).
Sourcepub fn set_fit_background(&mut self, background: Background)
pub fn set_fit_background(&mut self, background: Background)
Set the background theory subtracted before an iterative peak fit. The analytical Linear / Gaussian-estimate choices ignore it; iterative peak models fit the background-subtracted residual and display the reconstructed total curve.
Sourcepub fn param_constraints(&self) -> &[Constraint]
pub fn param_constraints(&self) -> &[Constraint]
The per-parameter constraints applied to the current single-peak model
(silx FitWidget parameter table). Empty until first synced.
Sourcepub fn set_param_constraints(&mut self, constraints: Vec<Constraint>)
pub fn set_param_constraints(&mut self, constraints: Vec<Constraint>)
Set the per-parameter constraints for the current single-peak model. The
vector is resynced to all-Free if its length stops matching the
selected model’s parameter count.
Sourcepub fn initial_params(&self) -> Option<&[f64]>
pub fn initial_params(&self) -> Option<&[f64]>
The editable initial parameters for the current single-peak model, once a
fit has populated them (silx FitWidget parameter table value column).
Sourcepub fn set_initial_params(&mut self, params: Option<Vec<f64>>)
pub fn set_initial_params(&mut self, params: Option<Vec<f64>>)
Set the initial parameters the next single-peak fit starts from. Dropped if the length stops matching the selected model’s parameter count.
Sourcepub fn iterative_result(&self) -> Option<&IterativeFitResult>
pub fn iterative_result(&self) -> Option<&IterativeFitResult>
The most recent iterative-fit result (covariance / chi-square), if the last successful fit used an iterative peak model.
Sourcepub fn perform_fit_choice(&mut self)
pub fn perform_fit_choice(&mut self)
Perform the fit using the currently selected FitModelChoice.
Iterative peak models are refined with Levenberg-Marquardt and populate the results table (per-parameter error + reduced chi-square); the analytical Linear / Gaussian-estimate choices keep their original behaviour. Honors the configured fit range.
Sourcepub fn perform_fit(&mut self)
pub fn perform_fit(&mut self)
Perform the fit using the currently selected function.
Auto Trait Implementations§
impl !RefUnwindSafe for FitWidget
impl !UnwindSafe for FitWidget
impl Freeze for FitWidget
impl Send for FitWidget
impl Sync for FitWidget
impl Unpin for FitWidget
impl UnsafeUnpin for FitWidget
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> 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.