casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PCFSpectralElement.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_PCFSPECTRALELEMENT_H
00029 #define COMPONENTS_PCFSPECTRALELEMENT_H
00030 
00031 #include <components/SpectralComponents/SpectralElement.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 // <summary>
00036 // Abstract base class that describes a spectral profile that can be parameterized
00037 // by a peak value (amplitude), center, and FWHM.
00038 // </summary>
00039 
00040 // <use visibility=export>
00041 
00042 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tSpectralFit" demos="">
00043 // </reviewed>
00044 
00045 // <prerequisite>
00046 //   <li> <linkto module=SpectralElement>SpectralElement</linkto> module
00047 // </prerequisite>
00048 //
00049 // <etymology>
00050 // From p(eak), c(enter), f(whm), and spectral line and element
00051 // </etymology>
00052 //
00053 // <synopsis>
00054 // Abstract base class that describes a spectral profile that can be parameterized
00055 // by a peak value (amplitude), center, and FWHM.
00056 // </synopsis>
00057 //
00058 // <example>
00059 // </example>
00060 //
00061 // <motivation>
00062 // To have a class containing common methods for things like Gaussian, Lorentzian,
00063 // and Voigt profiles.
00064 // </motivation>
00065 
00066 class PCFSpectralElement : public SpectralElement {
00067 public:
00068 
00069 
00070 
00071 
00072 
00073         //#Destructor
00074         // Destructor
00075         virtual ~PCFSpectralElement();
00076 
00077 //      PCFSpectralElement& operator=(const PCFSpectralElement &other);
00078 
00079         // Get amplitude
00080         Double getAmpl() const;
00081         // Get center value
00082         Double getCenter() const;
00083         // Get the width
00084         // <group>
00085         virtual Double getFWHM() const;
00086         // get the integral from -inf to inf
00087         virtual Double getIntegral() const = 0;
00088         // </group>
00089         // Get amplitude error estimate
00090         Double getAmplErr() const;
00091         // Get center value error estimate
00092         Double getCenterErr() const;
00093         // Get the width error estimate
00094         // <group>
00095         virtual Double getFWHMErr() const;
00096         virtual Double getIntegralErr() const;
00097         // </group>
00098         // Get error estimates of parameters
00099 
00100 
00101         void set(const Vector<Double>& param);
00102 
00103         void setAmpl(const Double ampl);
00104 
00105         void setCenter(const Double center);
00106 
00107         virtual void setFWHM(const Double fwhm);
00108 
00109 
00110         void fixAmpl(const Bool fix=True);
00111         void fixCenter(const Bool fix=True);
00112         void fixFWHM(const Bool fix=True);
00113         // fix parameters via encoded string. If s contains a, fix amplitude. If s contains f, fix fwhm.
00114         // If s contains c, fix center.
00115         void fixByString(const String& s);
00116         // </group>
00117 
00118 
00119         Bool fixedAmpl() const;
00120         Bool fixedCenter() const;
00121         Bool fixedFWHM() const;
00122 
00123 protected:
00124         PCFSpectralElement();
00125         PCFSpectralElement(const PCFSpectralElement& other);
00126 
00127 };
00128 
00129 } //# NAMESPACE CASA - END
00130 
00131 #endif