casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::SpectralList Class Reference

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...
 
SpectralListoperator= (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 SpectralElementoperator[] (const casacore::uInt n) const
 Get element n. More...
 
SpectralElementoperator[] (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...
 

Detailed Description

A set of SpectralElements.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tSpectralFit

Prerequisite

Etymology

From spectral line and element list

Synopsis

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.

Example

Motivation

To have a container for fitting of spectral profiles to an observed spectrum

To Do

Definition at line 85 of file SpectralList.h.

Constructor & Destructor Documentation

casa::SpectralList::SpectralList ( )

Default constructor creates an empty list.

casa::SpectralList::SpectralList ( casacore::uInt  nmax)
explicit

Construct a list with a maximum length of n (0: unlimited length)

casa::SpectralList::SpectralList ( const SpectralElement in)
explicit

Construct with an initial element.

casa::SpectralList::SpectralList ( const SpectralList other)

Copy constructor (deep copy)

casa::SpectralList::~SpectralList ( )

Destructor.

Member Function Documentation

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.

casacore::Int casa::SpectralList::compar ( const SpectralElement p1,
const SpectralElement p2 
) const
private

Compare two elements.

template<class MT >
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.

template<class MT >
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)
casacore::uInt casa::SpectralList::nelements ( ) const
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

Get element n.

Thrown Exceptions

SpectralElement* casa::SpectralList::operator[] ( const casacore::uInt  n)
template<class MT >
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.

Thrown Exceptions

template<class MT >
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

Member Data Documentation

casacore::PtrBlock<SpectralElement *> casa::SpectralList::list_p
private

casacore::List of elements

Definition at line 176 of file SpectralList.h.

Referenced by nelements().

casacore::uInt casa::SpectralList::nmax_p
private

Max length allowed of list.

Definition at line 174 of file SpectralList.h.


The documentation for this class was generated from the following file: