source: branches/casa-release-4_3-test02/external-alma/components/SpectralComponents/LorentzianSpectralElement.h@ 3005

Last change on this file since 3005 was 2980, checked in by Malte Marquarding, 10 years ago

Add a copy of casacore/components/SpectralComponents to external-alma directory to prepare for its removal from casacore-trunk. DOn;t activate in SConscript yet.

File size: 3.1 KB
Line 
1//# SpectralElement.h: Describes (a set of related) spectral lines
2//# Copyright (C) 2001,2003,2004
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: aips2-request@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25//#
26//#
27
28#ifndef COMPONENTS_LORENTZIANSPECTRALELEMENT_H
29#define COMPONENTS_LORENTZIANSPECTRALELEMENT_H
30
31#include <components/SpectralComponents/PCFSpectralElement.h>
32
33namespace casa { //# NAMESPACE CASA - BEGIN
34
35// <summary>
36// Describes a single Lorentzian spectral profile
37// </summary>
38
39// <use visibility=export>
40
41// <reviewed reviewer="" date="yyyy/mm/dd" tests="tSpectralFit" demos="">
42// </reviewed>
43
44// <prerequisite>
45// <li> <linkto class=SpectralElement>SpectralElement</linkto> module
46// </prerequisite>
47//
48// <etymology>
49// From Lorentzian and spectral profile and element
50// </etymology>
51//
52// <synopsis>
53// The LorentzianSpectralElement class describes a Lorentzian spectral profile.
54// </synopsis>
55//
56// <example>
57// </example>
58//
59// <motivation>
60// To have a container for data descrbing a Lorentzian spectral profile for fitting to an observed spectrum
61// </motivation>
62
63class LorentzianSpectralElement : public PCFSpectralElement {
64public:
65
66
67
68 // Construct with given type and values
69 // <thrown>
70 // <li> AipsError if fwhm == 0.0 or amp == 0.0
71 // </thrown>
72 LorentzianSpectralElement(
73 const Double ampl, const Double center,
74 const Double fwhm
75 );
76
77 LorentzianSpectralElement(const Vector<Double>& param);
78
79 // Copy constructor (deep copy)
80 LorentzianSpectralElement(const LorentzianSpectralElement& other);
81
82 ~LorentzianSpectralElement();
83
84 SpectralElement* clone() const;
85
86 // Assignment (copy semantics)
87 LorentzianSpectralElement& operator=(const LorentzianSpectralElement& other);
88
89 void setFWHM(Double fwhm) { setWidth(fwhm); }
90
91 Double getFWHM() const { return getWidth(); }
92
93 Double getFWHMErr() const { return getWidthErr(); }
94
95 // get the integral of the function
96 Double getIntegral() const;
97
98private:
99 // has amp = 1, center = 0, and fwhm = 1
100 LorentzianSpectralElement();
101
102};
103
104ostream &operator<<(ostream& os, const LorentzianSpectralElement& elem);
105
106} //# NAMESPACE CASA - END
107
108#endif
Note: See TracBrowser for help on using the repository browser.