Describes (a set of related) spectral lines. More...
#include <SpectralElement.h>
Public Types | |
enum | Types { GAUSSIAN, POLYNOMIAL, COMPILED, GMULTIPLET, LORENTZIAN, POWERLOGPOLY, LOGTRANSPOLY, N_Types } |
Supported spectral components. More... | |
Public Member Functions | |
virtual | ~SpectralElement () |
virtual SpectralElement * | clone () const =0 |
virtual Double | operator() (const Double x) const |
Evaluate the value of the element at x. | |
Bool | operator== (const SpectralElement &other) const |
virtual Double | operator[] (const uInt n) const |
Get parameter n. | |
SpectralElement::Types | getType () const |
Get type of this element. | |
void | get (Vector< Double > ¶ms) const |
Get all parameters. | |
Vector< Double > | get () const |
void | getError (Vector< Double > &err) const |
Get error estimates of parameters. | |
Vector< Double > | getError () const |
uInt | getOrder () const |
Get the order (i.e. | |
virtual void | setError (const Vector< Double > &err) |
Set the error fields. | |
virtual void | fix (const Vector< Bool > &fix) |
Set fixed parameters (True) or unset them (False). | |
const Vector< Bool > & | fixed () const |
Get the fix state[s]. | |
virtual Bool | toRecord (RecordInterface &out) const |
Save to a record. | |
virtual void | set (const Vector< Double > ¶ms) |
set parameters | |
Static Public Member Functions | |
static const String * | allTypes (Int &nall, const SpectralElement::Types *&typ) |
Get all the types available as String and codes, and number available. | |
static const String & | fromType (SpectralElement::Types tp) |
Get a string from the type. | |
static Bool | toType (SpectralElement::Types &tp, const String &typName) |
Get a type from a (non-case sensitive; minimum match) String. | |
Protected Member Functions | |
SpectralElement () | |
SpectralElement (Types type, const Vector< Double > &parms=Vector< Double >(0)) | |
SpectralElement (const SpectralElement &other) | |
SpectralElement & | operator= (const SpectralElement &other) |
void | _set (const Vector< Double > ¶ms) |
void | _setType (const Types type) |
void | _setFunction (const SHARED_PTR< Function< Double, Double > > &f) |
virtual SHARED_PTR< Function < Double, Double > > | _getFunction () const |
Private Attributes | |
Types | _type |
type of element | |
Vector< Double > | _params |
The parameters of the function. | |
Vector< Double > | _errors |
The errors of the parameters. | |
Vector< Bool > | _fixed |
The indication if the parameter has to be fixed (True) or solved (False). | |
SHARED_PTR< Function< Double, Double > > | _function |
Describes (a set of related) spectral lines.
Public interface
From spectral line and element
The SpectralElement class is the abstract base class for classes describing spectral components (Gaussian, Polynonomial, etc).
The element can be used in the SpectralFit class and in the SpectralEstimate class.
To have a container for fitting of spectral profiles to an observed spectrum
Definition at line 78 of file SpectralElement.h.
Supported spectral components.
Definition at line 83 of file SpectralElement.h.
virtual casa::SpectralElement::~SpectralElement | ( | ) | [virtual] |
casa::SpectralElement::SpectralElement | ( | ) | [inline, protected] |
Definition at line 162 of file SpectralElement.h.
casa::SpectralElement::SpectralElement | ( | Types | type, | |
const Vector< Double > & | parms = Vector< Double >(0) | |||
) | [protected] |
casa::SpectralElement::SpectralElement | ( | const SpectralElement & | other | ) | [protected] |
virtual SHARED_PTR<Function<Double, Double> > casa::SpectralElement::_getFunction | ( | ) | const [inline, protected, virtual] |
Definition at line 176 of file SpectralElement.h.
References _function.
void casa::SpectralElement::_set | ( | const Vector< Double > & | params | ) | [protected] |
Reimplemented in casa::GaussianSpectralElement.
void casa::SpectralElement::_setFunction | ( | const SHARED_PTR< Function< Double, Double > > & | f | ) | [protected] |
void casa::SpectralElement::_setType | ( | const Types | type | ) | [protected] |
static const String* casa::SpectralElement::allTypes | ( | Int & | nall, | |
const SpectralElement::Types *& | typ | |||
) | [static] |
Get all the types available as String and codes, and number available.
virtual SpectralElement* casa::SpectralElement::clone | ( | ) | const [pure virtual] |
virtual void casa::SpectralElement::fix | ( | const Vector< Bool > & | fix | ) | [virtual] |
Set fixed parameters (True) or unset them (False).
Fix/unfix all in one go
Reimplemented in casa::GaussianMultipletSpectralElement.
Referenced by casa::PCFSpectralElement::fixFWHM().
const Vector<Bool>& casa::SpectralElement::fixed | ( | ) | const |
Get the fix state[s].
static const String& casa::SpectralElement::fromType | ( | SpectralElement::Types | tp | ) | [static] |
Get a string from the type.
Vector<Double> casa::SpectralElement::get | ( | ) | const |
void casa::SpectralElement::get | ( | Vector< Double > & | params | ) | const |
Get all parameters.
Vector<Double> casa::SpectralElement::getError | ( | ) | const |
void casa::SpectralElement::getError | ( | Vector< Double > & | err | ) | const |
Get error estimates of parameters.
uInt casa::SpectralElement::getOrder | ( | ) | const [inline] |
Get the order (i.e.
the number of parameters)
Definition at line 138 of file SpectralElement.h.
References _params.
SpectralElement::Types casa::SpectralElement::getType | ( | ) | const [inline] |
virtual Double casa::SpectralElement::operator() | ( | const Double | x | ) | const [virtual] |
Evaluate the value of the element at x.
Reimplemented in casa::CompiledSpectralElement.
SpectralElement& casa::SpectralElement::operator= | ( | const SpectralElement & | other | ) | [protected] |
Bool casa::SpectralElement::operator== | ( | const SpectralElement & | other | ) | const |
Reimplemented in casa::GaussianMultipletSpectralElement.
virtual Double casa::SpectralElement::operator[] | ( | const uInt | n | ) | const [virtual] |
Get parameter n.
virtual void casa::SpectralElement::set | ( | const Vector< Double > & | params | ) | [virtual] |
set parameters
Reimplemented in casa::GaussianMultipletSpectralElement, casa::GaussianSpectralElement, and casa::PCFSpectralElement.
virtual void casa::SpectralElement::setError | ( | const Vector< Double > & | err | ) | [virtual] |
Set the error fields.
Reimplemented in casa::GaussianMultipletSpectralElement.
virtual Bool casa::SpectralElement::toRecord | ( | RecordInterface & | out | ) | const [virtual] |
Save to a record.
Reimplemented in casa::GaussianMultipletSpectralElement, and casa::GaussianSpectralElement.
static Bool casa::SpectralElement::toType | ( | SpectralElement::Types & | tp, | |
const String & | typName | |||
) | [static] |
Get a type from a (non-case sensitive; minimum match) String.
Vector<Double> casa::SpectralElement::_errors [private] |
The errors of the parameters.
Definition at line 189 of file SpectralElement.h.
Vector<Bool> casa::SpectralElement::_fixed [private] |
The indication if the parameter has to be fixed (True) or solved (False).
Solved is the default.
Definition at line 192 of file SpectralElement.h.
SHARED_PTR<Function<Double, Double> > casa::SpectralElement::_function [private] |
Definition at line 194 of file SpectralElement.h.
Referenced by _getFunction().
Vector<Double> casa::SpectralElement::_params [private] |
The parameters of the function.
I.e. the polynomial coefficients; amplitude, center and sigma of a Gaussian.
Definition at line 187 of file SpectralElement.h.
Referenced by getOrder().
Types casa::SpectralElement::_type [private] |