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

Describes a multiplet of Gaussian shaped spectral lines. More...

#include <GaussianMultipletSpectralElement.h>

Inheritance diagram for casa::GaussianMultipletSpectralElement:
casa::CompiledSpectralElement casa::SpectralElement

List of all members.

Public Member Functions

 GaussianMultipletSpectralElement (const Vector< GaussianSpectralElement > &estimates, const Matrix< Double > &fixedRelationships)
 Construct a Gaussian multiplet.
 GaussianMultipletSpectralElement (const GaussianMultipletSpectralElement &other)
 copy semantics
 ~GaussianMultipletSpectralElement ()
SpectralElementclone () const
GaussianMultipletSpectralElementoperator= (const GaussianMultipletSpectralElement &other)
 copy semantics
Bool operator== (const GaussianMultipletSpectralElement &other) const
const Vector
< GaussianSpectralElement > & 
getGaussians () const
 get the gaussians
const Matrix< Double > & getConstraints () const
 get the constraints matrix
void set (const Vector< Double > &param)
 These methods must be public because the architecture of the class hierarchy requires it and set() and setError() must be accessible by fitters.
void setError (const Vector< Double > &err)
 Set the error fields.
void fix (const Vector< Bool > &fix)
 Set fixed parameters (True) or unset them (False)
Bool toRecord (RecordInterface &out) const
 Save to a record.

Private Attributes

Vector< GaussianSpectralElement_gaussians
Matrix< Double_constraints
Matrix< uInt_paramIndices

Detailed Description

Describes a multiplet of Gaussian shaped spectral lines.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

From Gaussian and multiplet and spectral line and element

Synopsis

The GaussianMultipletSpectralElement class describes a multiplet of Gaussian shaped spectral lines for describing spectral profile.

Relationships between Gaussians in the multiplet must be specified. Any combination of one or more of fixed relationships between line center offsets, line amplitude ratios, and/or line width ratios can be specified between a single reference line in the multiplet and other (non-reference) lines in the multiplet. The constructor takes a Vector of GaussianSpectralElements which describes the estimates of the n Gaussians in the multiplet. These objects themselves are not used in the fitting, but are used only to create the function that describes the multiplet. The first element in this Vector represents the reference line to which parameters of the other lines are constrained. In addition, the constructor takes an n-1 x 3 Matrix<Double> describing the fixed relationships between the reference line and the other lines in the multiplet. Each ith row describes the fixed relationship(s) between the (i+1)th and the zeroth (reference) Gaussian. The first element of each row describes the ratio of amplitudes between the (i+1)th and reference Gaussian, the second element describes the difference between the center locations of the (i+1)th and reference Gaussian, and the third represents the ratio of the FWHM of the (i+1)th and reference Gaussian. A value of 0 for any of these indicates there is no fixed relationship for that parameter. At least one value must be non-zero for each row and any combination of elements (including all of them) can be non-zero for any row in this matrix. The values of parameters of non-reference lines in the input vector that are constrained to the reference line are implicitly ignored and set in the constructor according to the specified constraint. If any of the parameters of the reference line are specified as fixed, the corresponding parameters of any non-reference lines which have the corresponding parameters constrained to the reference line are also implicitly fixed. Fixing a parameter in a non-reference line that is constrained to the corresponding parameter of the reference line that is not fixed will cause an exception.

Example

This is how to specify a doublet in which the only constraint is that the amplitudes between the lines must be fixed, the first Gaussian must have an ampliute of 0.6 times the zeroth (reference) Gaussian. Other than that, all other parameters can vary during the fit:

GaussianSpectralElement reference(5, 25, 16); The amplitude value of first is ignored because of the relationship to the reference, but it still must be specified in the constructor and must be non-zero or an exception will be thrown. GaussianSpectralElement first(1, 40, 17); Vector<GaussianSpectralElement> pair(2); pair[0] = reference; pair[1] = first; initialize constraints matrix to have nothing constrained (all values 0) Matrix<Double> fixedRel(1, 3, 0); Set the ratio of amplitudes between the first and reference (zeroth) line to be 0.6. fixedRel[0][0] = 0.6 GaussianMultipletSpectralElement doublet(pair,"",fixedRel);

Motivation

To allow specifying constraints between different Gaussian spectral lines for fitting, eg to support fitting of doublets.

Definition at line 119 of file GaussianMultipletSpectralElement.h.


Constructor & Destructor Documentation

Construct a Gaussian multiplet.

The values of non-reference (non-zeroth) estimates will be automatically adjusted if there is a fixed relationship between a non-reference Gaussian parameter and the corresponding reference Gaussian parameter.

copy semantics


Member Function Documentation

Reimplemented from casa::CompiledSpectralElement.

void casa::GaussianMultipletSpectralElement::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 from casa::SpectralElement.

get the constraints matrix

get the gaussians

GaussianMultipletSpectralElement& casa::GaussianMultipletSpectralElement::operator= ( const GaussianMultipletSpectralElement other)

copy semantics

Bool casa::GaussianMultipletSpectralElement::operator== ( const GaussianMultipletSpectralElement other) const
void casa::GaussianMultipletSpectralElement::set ( const Vector< Double > &  param) [virtual]

These methods must be public because the architecture of the class hierarchy requires it and set() and setError() must be accessible by fitters.

However, it is strongly recommended that other classes not call these methods for object configuration but rather set them implicitly at construction via the Vector<GaussianSpectralElement> passed to the constructor.

Reimplemented from casa::SpectralElement.

Set the error fields.

Reimplemented from casa::SpectralElement.

Save to a record.

Reimplemented from casa::SpectralElement.


Member Data Documentation

Definition at line 174 of file GaussianMultipletSpectralElement.h.

Definition at line 173 of file GaussianMultipletSpectralElement.h.

Definition at line 175 of file GaussianMultipletSpectralElement.h.


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