casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LorentzianSpectralElement.h
Go to the documentation of this file.
00001 //# SpectralElement.h: Describes (a set of related) spectral lines
00002 //# Copyright (C) 2001,2003,2004
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 
00028 #ifndef COMPONENTS_LORENTZIANSPECTRALELEMENT_H
00029 #define COMPONENTS_LORENTZIANSPECTRALELEMENT_H
00030 
00031 #include <components/SpectralComponents/PCFSpectralElement.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 // <summary>
00036 // Describes a single Lorentzian spectral profile
00037 // </summary>
00038 
00039 // <use visibility=export>
00040 
00041 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tSpectralFit" demos="">
00042 // </reviewed>
00043 
00044 // <prerequisite>
00045 //   <li> <linkto module=SpectralElement>SpectralElement</linkto> module
00046 // </prerequisite>
00047 //
00048 // <etymology>
00049 // From Lorentzian and spectral profile and element
00050 // </etymology>
00051 //
00052 // <synopsis>
00053 // The LorentzianSpectralElement class describes a Lorentzian spectral profile.
00054 // </synopsis>
00055 //
00056 // <example>
00057 // </example>
00058 //
00059 // <motivation>
00060 // To have a container for data descrbing a Lorentzian spectral profile for fitting to an observed spectrum
00061 // </motivation>
00062 
00063 class LorentzianSpectralElement : public PCFSpectralElement {
00064 public:
00065 
00066         // has amp = 1, center = 0, and fwhm = 1
00067         LorentzianSpectralElement();
00068 
00069         // Construct with given type and values
00070         // <thrown>
00071         //   <li> AipsError if fwhm == 0.0 or amp == 0.0
00072         // </thrown>
00073         LorentzianSpectralElement(
00074                 const Double ampl, const Double center,
00075                 const Double fwhm
00076         );
00077 
00078         LorentzianSpectralElement(const Vector<Double>& param);
00079 
00080         // Copy constructor (deep copy)
00081         LorentzianSpectralElement(const LorentzianSpectralElement& other);
00082 
00083         ~LorentzianSpectralElement();
00084 
00085         SpectralElement* clone() const;
00086 
00087         // Assignment (copy semantics)
00088         LorentzianSpectralElement& operator=(const LorentzianSpectralElement& other);
00089 
00090         // Evaluate the value of the profile at x
00091         Double operator()(const Double x) const;
00092 
00093 
00094         // get the integral of the function
00095         Double getIntegral() const;
00096 
00097 
00098 };
00099 
00100 ostream &operator<<(ostream& os, const LorentzianSpectralElement& elem);
00101 
00102 } //# NAMESPACE CASA - END
00103 
00104 #endif