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

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

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 casacore::Double operator() (const casacore::Double x) const
 Evaluate the value of the element at x. More...
 
casacore::Bool operator== (const SpectralElement &other) const
 
virtual casacore::Double operator[] (const casacore::uInt n) const
 Get parameter n. More...
 
SpectralElement::Types getType () const
 Get type of this element. More...
 
void get (casacore::Vector< casacore::Double > &params) const
 Get all parameters. More...
 
casacore::Vector
< casacore::Double
get () const
 
void getError (casacore::Vector< casacore::Double > &err) const
 Get error estimates of parameters. More...
 
casacore::Vector
< casacore::Double
getError () const
 
casacore::uInt getOrder () const
 Get the order (i.e. More...
 
virtual void setError (const casacore::Vector< casacore::Double > &err)
 Set the error fields. More...
 
virtual void fix (const casacore::Vector< casacore::Bool > &fix)
 Set fixed parameters (true) or unset them (false) More...
 
const casacore::Vector
< casacore::Bool > & 
fixed () const
 Get the fix state[s]. More...
 
virtual casacore::Bool toRecord (casacore::RecordInterface &out) const
 Save to a record. More...
 
virtual void set (const casacore::Vector< casacore::Double > &params)
 set parameters More...
 

Static Public Member Functions

static const casacore::StringallTypes (casacore::Int &nall, const SpectralElement::Types *&typ)
 Get all the types available as casacore::String and codes, and number available. More...
 
static const casacore::StringfromType (SpectralElement::Types tp)
 Get a string from the type. More...
 
static casacore::Bool toType (SpectralElement::Types &tp, const casacore::String &typName)
 Get a type from a (non-case sensitive; minimum match) String. More...
 

Protected Member Functions

 SpectralElement ()
 
 SpectralElement (Types type, const casacore::Vector< casacore::Double > &parms=casacore::Vector< casacore::Double >(0))
 
 SpectralElement (const SpectralElement &other)
 
SpectralElementoperator= (const SpectralElement &other)
 
void _set (const casacore::Vector< casacore::Double > &params)
 
void _setType (const Types type)
 
void _setFunction (const std::shared_ptr< casacore::Function< casacore::Double, casacore::Double > > &f)
 
virtual std::shared_ptr
< casacore::Function
< casacore::Double,
casacore::Double > > 
_getFunction () const
 

Private Attributes

Types _type
 type of element More...
 
casacore::Vector
< casacore::Double
_params
 The parameters of the function. More...
 
casacore::Vector
< casacore::Double
_errors
 The errors of the parameters. More...
 
casacore::Vector< casacore::Bool_fixed
 The indication if the parameter has to be fixed (true) or solved (false). More...
 
std::shared_ptr
< casacore::Function
< casacore::Double,
casacore::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 82 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 87 of file SpectralElement.h.

Constructor & Destructor Documentation

virtual casa::SpectralElement::~SpectralElement ( )
virtual
casa::SpectralElement::SpectralElement ( )
inlineprotected

Definition at line 166 of file SpectralElement.h.

casa::SpectralElement::SpectralElement ( Types  type,
const casacore::Vector< casacore::Double > &  parms = casacore::Vectorcasacore::Double >(0) 
)
protected
casa::SpectralElement::SpectralElement ( const SpectralElement other)
protected

Member Function Documentation

virtual std::shared_ptr<casacore::Function<casacore::Double, casacore::Double> > casa::SpectralElement::_getFunction ( ) const
inlineprotectedvirtual

Definition at line 180 of file SpectralElement.h.

References _function.

void casa::SpectralElement::_set ( const casacore::Vector< casacore::Double > &  params)
protected
void casa::SpectralElement::_setFunction ( const std::shared_ptr< casacore::Function< casacore::Double, casacore::Double > > &  f)
protected
void casa::SpectralElement::_setType ( const Types  type)
protected
static const casacore::String* casa::SpectralElement::allTypes ( casacore::Int nall,
const SpectralElement::Types *&  typ 
)
static

Get all the types available as casacore::String and codes, and number available.

virtual SpectralElement* casa::SpectralElement::clone ( ) const
pure virtual
virtual void casa::SpectralElement::fix ( const casacore::Vector< casacore::Bool > &  fix)
virtual

Set fixed parameters (true) or unset them (false)

Thrown Exceptions

Fix/unfix all in one go

Reimplemented in casa::GaussianMultipletSpectralElement.

Referenced by casa::PCFSpectralElement::fixFWHM().

const casacore::Vector<casacore::Bool>& casa::SpectralElement::fixed ( ) const

Get the fix state[s].

static const casacore::String& casa::SpectralElement::fromType ( SpectralElement::Types  tp)
static

Get a string from the type.

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

Get all parameters.

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

Get error estimates of parameters.

casacore::Vector<casacore::Double> casa::SpectralElement::getError ( ) const
casacore::uInt casa::SpectralElement::getOrder ( ) const
inline

Get the order (i.e.

the number of parameters)

Definition at line 142 of file SpectralElement.h.

References _params, and casacore::ArrayBase::size().

SpectralElement::Types casa::SpectralElement::getType ( ) const
inline

Get type of this element.

Definition at line 130 of file SpectralElement.h.

References _type.

virtual casacore::Double casa::SpectralElement::operator() ( const casacore::Double  x) const
virtual

Evaluate the value of the element at x.

Reimplemented in casa::CompiledSpectralElement.

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

Get parameter n.

Thrown Exceptions

virtual void casa::SpectralElement::set ( const casacore::Vector< casacore::Double > &  params)
virtual
virtual void casa::SpectralElement::setError ( const casacore::Vector< casacore::Double > &  err)
virtual

Set the error fields.

Reimplemented in casa::GaussianMultipletSpectralElement.

virtual casacore::Bool casa::SpectralElement::toRecord ( casacore::RecordInterface out) const
virtual
static casacore::Bool casa::SpectralElement::toType ( SpectralElement::Types tp,
const casacore::String typName 
)
static

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

Member Data Documentation

casacore::Vector<casacore::Double> casa::SpectralElement::_errors
private

The errors of the parameters.

Definition at line 193 of file SpectralElement.h.

casacore::Vector<casacore::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 196 of file SpectralElement.h.

std::shared_ptr<casacore::Function<casacore::Double, casacore::Double> > casa::SpectralElement::_function
private

Definition at line 198 of file SpectralElement.h.

Referenced by _getFunction().

casacore::Vector<casacore::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 191 of file SpectralElement.h.

Referenced by getOrder().

Types casa::SpectralElement::_type
private

type of element

Definition at line 187 of file SpectralElement.h.

Referenced by getType().


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