casa
5.7.0-16
|
A set of SpectralElements. More...
#include <SpectralList.h>
Public Member Functions | |
SpectralList () | |
Default constructor creates an empty list. More... | |
SpectralList (casacore::uInt nmax) | |
Construct a list with a maximum length of n (0: unlimited length) More... | |
SpectralList (const SpectralElement &in) | |
Construct with an initial element. More... | |
SpectralList (const SpectralList &other) | |
Copy constructor (deep copy) More... | |
~SpectralList () | |
Destructor. More... | |
SpectralList & | operator= (const SpectralList &other) |
Assignment (copy semantics) More... | |
casacore::Double | operator() (const casacore::Double x) const |
Evaluate the value of the sum of the elements at x. More... | |
const SpectralElement * | operator[] (const casacore::uInt n) const |
Get element n. More... | |
SpectralElement * | operator[] (const casacore::uInt n) |
casacore::uInt | nelements () const |
Get the number of elements in list. More... | |
template<class MT > | |
void | evaluate (casacore::Vector< MT > &y) const |
Get the profile values for all elements in list. More... | |
template<class MT > | |
void | evaluate (casacore::Vector< MT > &y, const casacore::Vector< MT > &x) const |
template<class MT > | |
void | residual (casacore::Vector< MT > &y) const |
Calculate the residuals at the points x; by subtracting the model from y. More... | |
template<class MT > | |
void | residual (casacore::Vector< MT > &y, const casacore::Vector< MT > &x) const |
casacore::Bool | add (const SpectralElement &in) |
Add elements to list (false if list has max length and full) More... | |
casacore::Bool | add (const SpectralList &in) |
void | insert (const SpectralElement &in) |
Insert in sort order in the list. More... | |
void | insert (const SpectralList &in) |
casacore::Bool | set (const SpectralElement &in, const casacore::uInt which) |
Set an element in the list. More... | |
void | clear () |
Clear the list. More... | |
void | set (const casacore::uInt nmax) |
Set a maximum size of the list. More... | |
void | sort () |
casacore::Sort the list on the first parameter (i.e. More... | |
casacore::Bool | fromRecord (casacore::String &errMsg, const casacore::RecordInterface &container) |
Convert to and from a casacore::Record (see details in SpectralElement) More... | |
casacore::Bool | toRecord (casacore::RecordInterface &container) const |
Private Member Functions | |
casacore::Int | compar (const SpectralElement &p1, const SpectralElement &p2) const |
Compare two elements. More... | |
Private Attributes | |
casacore::uInt | nmax_p |
Max length allowed of list. More... | |
casacore::PtrBlock < SpectralElement * > | list_p |
casacore::List of elements More... | |
A set of SpectralElements.
Public interface
From spectral line and element list
The SpectralList class is a container for a set of spectral elements.
The list 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 85 of file SpectralList.h.
casa::SpectralList::SpectralList | ( | ) |
Default constructor creates an empty list.
|
explicit |
Construct a list with a maximum length of n (0: unlimited length)
|
explicit |
Construct with an initial element.
casa::SpectralList::SpectralList | ( | const SpectralList & | other | ) |
Copy constructor (deep copy)
casa::SpectralList::~SpectralList | ( | ) |
Destructor.
casacore::Bool casa::SpectralList::add | ( | const SpectralElement & | in | ) |
Add elements to list (false if list has max length and full)
casacore::Bool casa::SpectralList::add | ( | const SpectralList & | in | ) |
void casa::SpectralList::clear | ( | ) |
Clear the list.
|
private |
Compare two elements.
void casa::SpectralList::evaluate | ( | casacore::Vector< MT > & | y | ) | const |
Get the profile values for all elements in list.
The evaluation is for the length of the given prof
, assuming x values of 0,1,... if no x given.
void casa::SpectralList::evaluate | ( | casacore::Vector< MT > & | y, |
const casacore::Vector< MT > & | x | ||
) | const |
casacore::Bool casa::SpectralList::fromRecord | ( | casacore::String & | errMsg, |
const casacore::RecordInterface & | container | ||
) |
Convert to and from a casacore::Record (see details in SpectralElement)
void casa::SpectralList::insert | ( | const SpectralElement & | in | ) |
Insert in sort order in the list.
void casa::SpectralList::insert | ( | const SpectralList & | in | ) |
|
inline |
Get the number of elements in list.
Definition at line 118 of file SpectralList.h.
References list_p.
casacore::Double casa::SpectralList::operator() | ( | const casacore::Double | x | ) | const |
Evaluate the value of the sum of the elements at x.
SpectralList& casa::SpectralList::operator= | ( | const SpectralList & | other | ) |
Assignment (copy semantics)
const SpectralElement* casa::SpectralList::operator[] | ( | const casacore::uInt | n | ) | const |
SpectralElement* casa::SpectralList::operator[] | ( | const casacore::uInt | n | ) |
void casa::SpectralList::residual | ( | casacore::Vector< MT > & | y | ) | const |
Calculate the residuals at the points x; by subtracting the model from y.
x=0,1,2,.. if not given.
void casa::SpectralList::residual | ( | casacore::Vector< MT > & | y, |
const casacore::Vector< MT > & | x | ||
) | const |
casacore::Bool casa::SpectralList::set | ( | const SpectralElement & | in, |
const casacore::uInt | which | ||
) |
Set an element in the list.
Return false if more than one place beyond end of list; or if beyond max size.
void casa::SpectralList::set | ( | const casacore::uInt | nmax | ) |
Set a maximum size of the list.
void casa::SpectralList::sort | ( | ) |
casacore::Sort the list on the first parameter (i.e.
peak value for Gaussian)
casacore::Bool casa::SpectralList::toRecord | ( | casacore::RecordInterface & | container | ) | const |
|
private |
casacore::List of elements
Definition at line 176 of file SpectralList.h.
Referenced by nelements().
|
private |
Max length allowed of list.
Definition at line 174 of file SpectralList.h.