casa
5.7.0-16
|
Least Squares fitting of spectral elements to spectrum. More...
#include <SpectralFit.h>
Public Member Functions | |
SpectralFit () | |
Default constructor creates a default fitter without elements. More... | |
SpectralFit (const SpectralList &in) | |
Construct for the given elements. More... | |
SpectralFit (const SpectralFit &other) | |
Copy constructor (deep copy) More... | |
~SpectralFit () | |
Destructor. More... | |
SpectralFit & | operator= (const SpectralFit &other) |
Assignment (copy semantics) More... | |
void | setFitElement (casacore::uInt index, const SpectralElement &elem) |
Set an element to be fitted. More... | |
void | addFitElement (const SpectralElement &elem) |
Add elements to be fitted. More... | |
void | addFitElement (const SpectralList &elem) |
void | clear () |
Clear the list to be fitted (for a re-use of the SpectralFit object) More... | |
const SpectralList & | list () const |
Get the list being fitted. More... | |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &y, const casacore::Vector< MT > &x) |
Fit the elements as given by the specified spectral elements at the frequencies x with values y. More... | |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &y, const casacore::Vector< MT > &x, const casacore::Vector< casacore::Bool > &mask) |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &sigma, const casacore::Vector< MT > &y, const casacore::Vector< MT > &x) |
Fit the elements as given by the specified spectral elements at the frequencies x with values y and weights sigma. More... | |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &sigma, const casacore::Vector< MT > &y, const casacore::Vector< MT > &x, const casacore::Vector< casacore::Bool > &mask) |
casacore::uInt | nIterations () const |
Get the number of iterations last fit. More... | |
casacore::Double | chiSq () const |
Get ChiSq of the last fit. More... | |
Private Member Functions | |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &y, const casacore::Vector< MT > &x, const casacore::Vector< casacore::Bool > *mask) |
Real fitters. More... | |
template<class MT > | |
casacore::Bool | fit (const casacore::Vector< MT > &sigma, const casacore::Vector< MT > &y, const casacore::Vector< MT > &x, const casacore::Vector< casacore::Bool > *mask) |
Private Attributes | |
SpectralList | slist_p |
Elements to be fitted. More... | |
casacore::uInt | iter_p |
Number of iterations last fit. More... | |
casacore::Double | chiSq_p |
ChiSq of last fit. More... | |
Least Squares fitting of spectral elements to spectrum.
Public interface
From spectral line and fitting
The SpectralFit class will do a non-linear least squares solution for a number of simultaneous spectral components. The initial guess of the elements is given in a set of SpectralElements. The final solution is returned in the same set.
To have a contained fitting of spectral profiles to an observed spectrum
Definition at line 83 of file SpectralFit.h.
casa::SpectralFit::SpectralFit | ( | ) |
Default constructor creates a default fitter without elements.
|
explicit |
Construct for the given elements.
casa::SpectralFit::SpectralFit | ( | const SpectralFit & | other | ) |
Copy constructor (deep copy)
casa::SpectralFit::~SpectralFit | ( | ) |
Destructor.
void casa::SpectralFit::addFitElement | ( | const SpectralElement & | elem | ) |
Add elements to be fitted.
void casa::SpectralFit::addFitElement | ( | const SpectralList & | elem | ) |
|
inline |
Get ChiSq of the last fit.
Definition at line 153 of file SpectralFit.h.
References chiSq_p.
Referenced by casa::ProfileFit1D< FitterType >::getChiSquared().
void casa::SpectralFit::clear | ( | ) |
Clear the list to be fitted (for a re-use of the SpectralFit object)
|
inline |
Fit the elements as given by the specified spectral elements at the frequencies x with values y.
Weights of all points are equal. The mask (if specified) means: use point if true. Returns the convergence status.
Definition at line 125 of file SpectralFit.h.
Referenced by fit().
|
inline |
Definition at line 128 of file SpectralFit.h.
References fit().
|
inline |
Fit the elements as given by the specified spectral elements at the frequencies x with values y and weights sigma.
The mask (if specified) means: use point if true.
Definition at line 138 of file SpectralFit.h.
References fit().
|
inline |
Definition at line 143 of file SpectralFit.h.
References fit().
|
private |
Real fitters.
|
private |
|
inline |
|
inline |
Get the number of iterations last fit.
Definition at line 150 of file SpectralFit.h.
References iter_p.
Referenced by casa::ProfileFit1D< FitterType >::getNumberIterations().
SpectralFit& casa::SpectralFit::operator= | ( | const SpectralFit & | other | ) |
Assignment (copy semantics)
void casa::SpectralFit::setFitElement | ( | casacore::uInt | index, |
const SpectralElement & | elem | ||
) |
|
private |
|
private |
Number of iterations last fit.
Definition at line 160 of file SpectralFit.h.
Referenced by nIterations().
|
private |