casa
5.7.0-16
|
#include <SpectralFitter.h>
Public Types | |
enum | FitStatus { UNKNOWN, FAILED, SUCCESS } |
Does a simple fit to data in vectors. It is possible to specify weights (or errors) for each element. A single Gaussian and a polynimial of order N are the only component that can be fitted. More... | |
Public Member Functions | |
SpectralFitter () | |
default constructor More... | |
virtual | ~SpectralFitter () |
destructor More... | |
virtual casacore::Bool | fit (const casacore::Vector< casacore::Float > &spcVals, const casacore::Vector< casacore::Float > &yVals, const casacore::Vector< casacore::Float > &eVals, const casacore::Float startVal, const casacore::Float endVal, const casacore::Bool fitGauss, const casacore::Bool fitPoly, const casacore::uInt nPoly, casacore::String &msg) |
Parameters: spcVals - independent values yVals - dependent values eVals - error values startVal - lower boundary for independent values to be included in the fit endVal - upper boundary for independent values to be included in the fit fitGauss - fit Gaussian component fitPoly - fit polynomial nPoly - order of polynomial to be fitted msg - message back to the calling routine. More... | |
const SpectralFitter::FitStatus & | getStatus () |
get the status of the last fit More... | |
casacore::Double | getChiSquared () const |
get Chi Squared of the last fit More... | |
casacore::Double | getNumberIterations () const |
get number of iterations for the last fit More... | |
const SpectralList & | getList () const |
casacore::Vector < casacore::Double > | getFit () const |
get all values for the last fit More... | |
void | getFit (const casacore::Vector< casacore::Float > &spcVals, casacore::Vector< casacore::Float > &spcFit, casacore::Vector< casacore::Float > &yFit) const |
get the values in the specified data range for the last fit More... | |
casacore::Vector < casacore::Double > | getResidual () const |
get all residuals for the last fit More... | |
casacore::String | report (casacore::LogIO &os, const casacore::String &xUnit="", const casacore::String &yUnit="", const casacore::String &yPrefixUnit="") const |
report on the last fit to a stream More... | |
Private Member Functions | |
void | _setUp () |
do all necessary setup More... | |
casacore::Bool | _prepareData (const casacore::Vector< casacore::Float > &xVals, const casacore::Vector< casacore::Float > &eVals, const casacore::Int &startIndex, const casacore::Int &endIndex, casacore::Vector< casacore::Bool > &maskVals, casacore::Vector< casacore::Double > &weightVals) const |
prepare the data which means give all data (independent, dependent, weights) to the fitting class More... | |
casacore::Bool | _prepareElems (const casacore::Bool fitGauss, const casacore::Bool fitPoly, const casacore::uInt nPoly, casacore::Vector< casacore::Double > &xVals, casacore::Vector< casacore::Double > &yVals, SpectralList &list) |
prepare the components that shall be fitted; this includes the setting of reasonable initial parameters More... | |
casacore::String | _report (casacore::LogIO &os, const SpectralList &list, const casacore::String &xUnit="", const casacore::String &yUnit="", const casacore::String &yPrefixUnit="") const |
report on a list of spectral elements to a stream More... | |
Definition at line 48 of file SpectralFitter.h.
Does a simple fit to data in vectors. It is possible to specify weights (or errors) for each element. A single Gaussian and a polynimial of order N are the only component that can be fitted.
Created to fit components to spectra from the spectral profiler, hence SpectralFitter.
Enumerator | |
---|---|
UNKNOWN | |
FAILED | |
SUCCESS |
Definition at line 71 of file SpectralFitter.h.
casa::SpectralFitter::SpectralFitter | ( | ) |
default constructor
|
virtual |
destructor
|
private |
prepare the data which means give all data (independent, dependent, weights) to the fitting class
|
private |
prepare the components that shall be fitted; this includes the setting of reasonable initial parameters
|
private |
report on a list of spectral elements to a stream
|
private |
do all necessary setup
|
virtual |
Parameters: spcVals
- independent values yVals
- dependent values eVals
- error values startVal
- lower boundary for independent values to be included in the fit endVal
- upper boundary for independent values to be included in the fit fitGauss
- fit Gaussian component fitPoly
- fit polynomial nPoly
- order of polynomial to be fitted msg
- message back to the calling routine.
|
inline |
get Chi Squared of the last fit
Definition at line 100 of file SpectralFitter.h.
References _fit, and casa::ProfileFit1D< T >::getChiSquared().
|
inline |
get all values for the last fit
Definition at line 108 of file SpectralFitter.h.
References _fit, and casa::ProfileFit1D< T >::getFit().
void casa::SpectralFitter::getFit | ( | const casacore::Vector< casacore::Float > & | spcVals, |
casacore::Vector< casacore::Float > & | spcFit, | ||
casacore::Vector< casacore::Float > & | yFit | ||
) | const |
get the values in the specified data range for the last fit
|
inline |
Definition at line 105 of file SpectralFitter.h.
References _fit, and casa::ProfileFit1D< T >::getList().
|
inline |
get number of iterations for the last fit
Definition at line 103 of file SpectralFitter.h.
References _fit, and casa::ProfileFit1D< T >::getNumberIterations().
|
inline |
get all residuals for the last fit
Definition at line 114 of file SpectralFitter.h.
References _fit, and casa::ProfileFit1D< T >::getResidual().
|
inline |
get the status of the last fit
Definition at line 97 of file SpectralFitter.h.
References _fitStatus.
casacore::String casa::SpectralFitter::report | ( | casacore::LogIO & | os, |
const casacore::String & | xUnit = "" , |
||
const casacore::String & | yUnit = "" , |
||
const casacore::String & | yPrefixUnit = "" |
||
) | const |
report on the last fit to a stream
|
private |
Definition at line 129 of file SpectralFitter.h.
|
private |
Definition at line 127 of file SpectralFitter.h.
|
private |
Definition at line 122 of file SpectralFitter.h.
Referenced by getChiSquared(), getFit(), getList(), getNumberIterations(), and getResidual().
|
private |
Definition at line 124 of file SpectralFitter.h.
Referenced by getStatus().
|
private |
Definition at line 120 of file SpectralFitter.h.
|
private |
Definition at line 131 of file SpectralFitter.h.
|
private |
Definition at line 128 of file SpectralFitter.h.
|
private |
Definition at line 126 of file SpectralFitter.h.