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

Describes a Gaussian spectral line. More...

#include <GaussianSpectralElement.h>

Inheritance diagram for casa::GaussianSpectralElement:
casa::PCFSpectralElement casa::SpectralElement

Public Member Functions

 GaussianSpectralElement ()
 Default constructor creates a default Gaussian element with an amplitude of 1; an integral (sigma=2sqrt(ln2)/pi) of 1; a central frequency of zero. More...
 
 GaussianSpectralElement (const casacore::Double ampl, const casacore::Double center, const casacore::Double sigma)
 Construct with given type and values. More...
 
 GaussianSpectralElement (const casacore::Vector< casacore::Double > &param)
 Construct the given tp with the given param. More...
 
 GaussianSpectralElement (const GaussianSpectralElement &other)
 Copy constructor (deep copy) More...
 
 ~GaussianSpectralElement ()
 Destructor. More...
 
SpectralElementclone () const
 
casacore::Double getSigma () const
 Assignment (copy semantics) More...
 
casacore::Double getFWHM () const
 
casacore::Double getSigmaErr () const
 
casacore::Double getFWHMErr () const
 
void setSigma (casacore::Double sigma)
 
void setFWHM (casacore::Double fwhm)
 
void fixSigma (const casacore::Bool fix=true)
 
casacore::Bool fixedSigma () const
 
casacore::Double getIntegral () const
 get the integral from -inf to inf More...
 
casacore::Bool toRecord (casacore::RecordInterface &out) const
 Save to a record. More...
 
void set (const casacore::Vector< casacore::Double > &v)
 Get error estimates of parameters. More...
 
- Public Member Functions inherited from casa::PCFSpectralElement
virtual ~PCFSpectralElement ()
 Destructor. More...
 
casacore::Double getAmpl () const
 PCFSpectralElement& operator=(const PCFSpectralElement &other);. More...
 
casacore::Double getCenter () const
 Get center value. More...
 
virtual casacore::Double getWidth () const
 Get the width. More...
 
casacore::Double getAmplErr () const
 Get amplitude error estimate. More...
 
casacore::Double getCenterErr () const
 Get center value error estimate. More...
 
virtual casacore::Double getWidthErr () const
 Get the width error estimate. More...
 
virtual casacore::Double getIntegralErr () const
 
void setAmpl (const casacore::Double ampl)
 
void setCenter (const casacore::Double center)
 
virtual void setWidth (const casacore::Double width)
 
void fixAmpl (const casacore::Bool fix=true)
 
void fixCenter (const casacore::Bool fix=true)
 
void fixWidth (const casacore::Bool fix=true)
 
void fixFWHM (const casacore::Bool fix=true)
 
void fixByString (const casacore::String &s)
 fix parameters via encoded string. More...
 
- Public Member Functions inherited from casa::SpectralElement
virtual ~SpectralElement ()
 
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...
 

Static Public Member Functions

static casacore::Double sigmaFromFWHM (const casacore::Double fwhm)
 Sigma to FWHM Convert from sigma to FWHM and vice versa. More...
 
static casacore::Double sigmaToFWHM (const casacore::Double sigma)
 
- Static Public Member Functions inherited from casa::SpectralElement
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...
 

Static Public Attributes

static const casacore::Double SigmaToFWHM
 Sigma to FWHM conversion factor. More...
 

Private Member Functions

void _set (const casacore::Vector< casacore::Double > &v)
 need to overrride SpectralElement::_set() because _param[2] is sigma but the second param of the corresponding casacore::Gaussian1D function is the FWHM :( More...
 

Additional Inherited Members

- Public Types inherited from casa::PCFSpectralElement
enum  ParamType {
  AMP,
  CENTER,
  WIDTH
}
 to help avoid having to hard code parameter indices More...
 
- Public Types inherited from casa::SpectralElement
enum  Types {
  GAUSSIAN,
  POLYNOMIAL,
  COMPILED,
  GMULTIPLET,
  LORENTZIAN,
  POWERLOGPOLY,
  LOGTRANSPOLY,
  N_Types
}
 Supported spectral components. More...
 
- Protected Member Functions inherited from casa::SpectralElement
 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
 

Detailed Description

Describes a Gaussian spectral line.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

From Gaussian and spectral line and element

Synopsis

The GaussianSpectralElement class describes a Gaussian spectral line.

Example

Motivation

To have a container for data descrbing a Gaussian spectral profile for fitting to an observed spectrum

Definition at line 64 of file GaussianSpectralElement.h.

Constructor & Destructor Documentation

casa::GaussianSpectralElement::GaussianSpectralElement ( )

Default constructor creates a default Gaussian element with an amplitude of 1; an integral (sigma=2sqrt(ln2)/pi) of 1; a central frequency of zero.

It's necessary for this to be public because Arrays of this class require access to the default constructor. It should never be used in code developers write though.

casa::GaussianSpectralElement::GaussianSpectralElement ( const casacore::Double  ampl,
const casacore::Double  center,
const casacore::Double  sigma 
)

Construct with given type and values.

Thrown Exceptions

casa::GaussianSpectralElement::GaussianSpectralElement ( const casacore::Vector< casacore::Double > &  param)

Construct the given tp with the given param.

Thrown Exceptions

casa::GaussianSpectralElement::GaussianSpectralElement ( const GaussianSpectralElement other)

Copy constructor (deep copy)

Thrown Exceptions

casa::GaussianSpectralElement::~GaussianSpectralElement ( )

Destructor.

Member Function Documentation

void casa::GaussianSpectralElement::_set ( const casacore::Vector< casacore::Double > &  v)
private

need to overrride SpectralElement::_set() because _param[2] is sigma but the second param of the corresponding casacore::Gaussian1D function is the FWHM :(

SpectralElement* casa::GaussianSpectralElement::clone ( ) const
virtual

Implements casa::SpectralElement.

casacore::Bool casa::GaussianSpectralElement::fixedSigma ( ) const
void casa::GaussianSpectralElement::fixSigma ( const casacore::Bool  fix = true)
casacore::Double casa::GaussianSpectralElement::getFWHM ( ) const
virtual
casacore::Double casa::GaussianSpectralElement::getFWHMErr ( ) const
virtual
casacore::Double casa::GaussianSpectralElement::getIntegral ( ) const
virtual

get the integral from -inf to inf

Implements casa::PCFSpectralElement.

casacore::Double casa::GaussianSpectralElement::getSigma ( ) const

Assignment (copy semantics)

Thrown Exceptions

GaussianSpectralElement& operator=(const GaussianSpectralElement &other); Evaluate the value of the element at x casacore::Double operator()(const casacore::Double x) const;

casacore::Double casa::GaussianSpectralElement::getSigmaErr ( ) const
void casa::GaussianSpectralElement::set ( const casacore::Vector< casacore::Double > &  param)
virtual

Get error estimates of parameters.

Reimplemented from casa::PCFSpectralElement.

void casa::GaussianSpectralElement::setFWHM ( casacore::Double  fwhm)
void casa::GaussianSpectralElement::setSigma ( casacore::Double  sigma)
static casacore::Double casa::GaussianSpectralElement::sigmaFromFWHM ( const casacore::Double  fwhm)
static

Sigma to FWHM Convert from sigma to FWHM and vice versa.

static casacore::Double casa::GaussianSpectralElement::sigmaToFWHM ( const casacore::Double  sigma)
static
casacore::Bool casa::GaussianSpectralElement::toRecord ( casacore::RecordInterface out) const
virtual

Save to a record.

For Gaussian elements, the width is defined as a FWHM in the record interface.

Reimplemented from casa::SpectralElement.

Member Data Documentation

const casacore::Double casa::GaussianSpectralElement::SigmaToFWHM
static

Sigma to FWHM conversion factor.

Definition at line 78 of file GaussianSpectralElement.h.


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