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 
00067 
00068         // Construct with given type and values
00069         // <thrown>
00070         //   <li> AipsError if fwhm == 0.0 or amp == 0.0
00071         // </thrown>
00072         LorentzianSpectralElement(
00073                 const Double ampl, const Double center,
00074                 const Double fwhm
00075         );
00076 
00077         LorentzianSpectralElement(const Vector<Double>& param);
00078 
00079         // Copy constructor (deep copy)
00080         LorentzianSpectralElement(const LorentzianSpectralElement& other);
00081 
00082         ~LorentzianSpectralElement();
00083 
00084         SpectralElement* clone() const;
00085 
00086         // Assignment (copy semantics)
00087         LorentzianSpectralElement& operator=(const LorentzianSpectralElement& other);
00088 
00089         void setFWHM(Double fwhm) { setWidth(fwhm); }
00090 
00091         Double getFWHM() const { return getWidth(); }
00092 
00093         Double getFWHMErr() const { return getWidthErr(); }
00094 
00095         // get the integral of the function
00096         Double getIntegral() const;
00097 
00098 private:
00099         // has amp = 1, center = 0, and fwhm = 1
00100                 LorentzianSpectralElement();
00101 
00102 };
00103 
00104 ostream &operator<<(ostream& os, const LorentzianSpectralElement& elem);
00105 
00106 } //# NAMESPACE CASA - END
00107 
00108 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1