casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LorentzianSpectralElement.h
Go to the documentation of this file.
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 
32 
33 namespace 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 module=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 
64 public:
65 
66 
67 
68  // Construct with given type and values
69  // <thrown>
70  // <li> casacore::AipsError if fwhm == 0.0 or amp == 0.0
71  // </thrown>
73  const casacore::Double ampl, const casacore::Double center,
74  const casacore::Double fwhm
75  );
76 
78 
79  // Copy constructor (deep copy)
81 
83 
84  SpectralElement* clone() const;
85 
86  // Assignment (copy semantics)
88 
89  void setFWHM(casacore::Double fwhm) { setWidth(fwhm); }
90 
91  casacore::Double getFWHM() const { return getWidth(); }
92 
93  casacore::Double getFWHMErr() const { return getWidthErr(); }
94 
95  // get the integral of the function
97 
98 private:
99  // has amp = 1, center = 0, and fwhm = 1
101 
102 };
103 
104 std::ostream &operator<<(std::ostream& os, const LorentzianSpectralElement& elem);
105 
106 } //# NAMESPACE CASA - END
107 
108 #endif
LorentzianSpectralElement()
has amp = 1, center = 0, and fwhm = 1
ostream & operator<<(ostream &os, const PageHeaderCache &cache)
void setFWHM(casacore::Double fwhm)
virtual casacore::Double getWidth() const
Get the width.
virtual void setWidth(const casacore::Double width)
Describes (a set of related) spectral lines.
Describes a single Lorentzian spectral profile.
double Double
Definition: aipstype.h:55
Abstract base class that describes a spectral profile that can be parameterized by a peak value (ampl...
virtual casacore::Double getWidthErr() const
Get the width error estimate.
casacore::Double getIntegral() const
get the integral of the function
LorentzianSpectralElement & operator=(const LorentzianSpectralElement &other)
Assignment (copy semantics)
SpectralElement * clone() const