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::PowerLogPolynomialSpectralElement casa::GaussianMultipletSpectralElement casa::GaussianSpectralElement casa::LorentzianSpectralElement casa::LogTransformedPolynomialSpectralElement

List of all members.

Public Types

enum  Types {
  GAUSSIAN,
  POLYNOMIAL,
  COMPILED,
  GMULTIPLET,
  LORENTZIAN,
  POWERLOGPOLY,
  LOGTRANSPOLY,
  N_Types
}
 

Supported spectral components.

More...

Public Member Functions

virtual ~SpectralElement ()
virtual SpectralElementclone () 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 > &params) 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 > &params)
 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)
SpectralElementoperator= (const SpectralElement &other)
void _set (const Vector< Double > &params)
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

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 78 of file SpectralElement.h.


Member Enumeration Documentation

Supported spectral components.

Enumerator:
GAUSSIAN 

A gaussian profile.

POLYNOMIAL 

A polynomial baseline.

COMPILED 

Any compiled string functional.

GMULTIPLET 

Gaussian multiplet.

LORENTZIAN 

Lorentzian.

POWERLOGPOLY 

power log polynomial

LOGTRANSPOLY 

log transformed polynomial

N_Types 

Definition at line 83 of file SpectralElement.h.


Constructor & Destructor Documentation

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]

Member Function Documentation

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).

Thrown Exceptions

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

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]

Get type of this element.

Definition at line 126 of file SpectralElement.h.

References _type.

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
virtual Double casa::SpectralElement::operator[] ( const uInt  n  )  const [virtual]

Get parameter n.

Thrown Exceptions

  • AipsError if illegal n
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

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().

type of element

Definition at line 183 of file SpectralElement.h.

Referenced by getType().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1