casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
casa::SpectralElement Class Reference

Describes (a set of related) spectral lines. More...

#include <SpectralElement.h>

Inheritance diagram for casa::SpectralElement:
casa::CompiledSpectralElement casa::PCFSpectralElement casa::PolynomialSpectralElement casa::GaussianMultipletSpectralElement casa::GaussianSpectralElement casa::LorentzianSpectralElement

List of all members.

Public Types

enum  Types {
  GAUSSIAN,
  POLYNOMIAL,
  COMPILED,
  GMULTIPLET,
  LORENTZIAN,
  N_Types
}
 Types of spectral lines known. More...

Public Member Functions

virtual ~SpectralElement ()
virtual SpectralElementclone () const =0
virtual Double operator() (const Double x) const =0
 Evaluate the value of the element at x.
virtual Bool operator== (const SpectralElement &other) const
virtual Double operator[] (const uInt n) const
 Get parameter n.
SpectralElement::Types getType () const
 Get the data for this element.
void get (Vector< Double > &params) const
 Get all parameters.
Vector< Doubleget () const
void getError (Vector< Double > &err) const
 Get error estimates of parameters.
Vector< DoublegetError () 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 > &params)
 set parameters

Static Public Member Functions

static const StringallTypes (Int &nall, const SpectralElement::Types *&typ)
 Get all the types available as String and codes, and number available.
static const StringfromType (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 (const SpectralElement &other)
SpectralElementoperator= (const SpectralElement &other)
void _construct (const Types type, const Vector< Double > &params)
void _set (const Vector< Double > &params)
void _setType (const Types type)

Private Attributes

Types tp_p
 type of element
Vector< Doublepar_p
 The parameters of the function.
Vector< Doubleerr_p
 The errors of the parameters.
Vector< Boolfix_p
 The indication if the parameter has to be fixed (True) or solved (False).

Detailed Description

Describes (a set of related) spectral lines.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

From spectral line and element

Synopsis

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.

Example

Motivation

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

To Do

Definition at line 76 of file SpectralElement.h.


Member Enumeration Documentation

Types of spectral lines known.

Enumerator:
GAUSSIAN 

A gaussian profile.

POLYNOMIAL 

A polynomial baseline.

COMPILED 

Any compiled string functional.

GMULTIPLET 

Gaussian multiplet.

LORENTZIAN 

Lorentzian.

N_Types 

Definition at line 81 of file SpectralElement.h.


Constructor & Destructor Documentation

casa::SpectralElement::SpectralElement ( ) [inline, protected]

Definition at line 161 of file SpectralElement.h.


Member Function Documentation

void casa::SpectralElement::_construct ( const Types  type,
const Vector< Double > &  params 
) [protected]
void casa::SpectralElement::_set ( const Vector< Double > &  params) [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)

Thrown Exceptions

  • AipsError if incorrect number of parameters (e.g. not 3 for GAUSSIAN)

Fix/unfix all in one go

Reimplemented in casa::GaussianMultipletSpectralElement.

Get the fix state[s].

Get a string from the type.

void casa::SpectralElement::get ( Vector< Double > &  params) const

Get all parameters.

void casa::SpectralElement::getError ( Vector< Double > &  err) const

Get error estimates of parameters.

Get the order (i.e.

the number of parameters)

Definition at line 138 of file SpectralElement.h.

References casa::ArrayBase::nelements(), and par_p.

Get the data for this element.

Thrown Exceptions

  • AipsError if element does not have data (e.g. amplitude for POLYNOMIAL)

Get type of this element

Definition at line 126 of file SpectralElement.h.

References tp_p.

virtual Double casa::SpectralElement::operator() ( const Double  x) const [pure virtual]
SpectralElement& casa::SpectralElement::operator= ( const SpectralElement other) [protected]
virtual Bool casa::SpectralElement::operator== ( const SpectralElement other) const [virtual]
virtual Double casa::SpectralElement::operator[] ( const uInt  n) const [virtual]

Get parameter n.

Thrown Exceptions

virtual void casa::SpectralElement::set ( const Vector< Double > &  params) [virtual]
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]
static Bool casa::SpectralElement::toType ( SpectralElement::Types tp,
const String typName 
) [static]

Get a type from a (non-case sensitive; minimum match) String.


Member Data Documentation

The errors of the parameters.

Definition at line 182 of file SpectralElement.h.

The indication if the parameter has to be fixed (True) or solved (False).

Solved is the default.

Definition at line 185 of file SpectralElement.h.

The parameters of the function.

I.e. the polynomial coefficients; amplitude, center and sigma of a Gaussian.

Definition at line 180 of file SpectralElement.h.

Referenced by getOrder().

type of element

Definition at line 176 of file SpectralElement.h.

Referenced by getType().


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