casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CompiledSpectralElement.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 //# $Id: SpectralElement.h 20652 2009-07-06 05:04:32Z Malte.Marquarding $
00028 
00029 #ifndef COMPONENTS_COMPILEDSPECTRALELEMENT_H
00030 #define COMPONENTS_COMPILEDSPECTRALELEMENT_H
00031 
00032 #include <components/SpectralComponents/SpectralElement.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary>
00037 // Describes a compiled function for describing a spectral profile
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 compiled and spectral line and element
00051 // </etymology>
00052 //
00053 // <synopsis>
00054 // The CompiledSpectralElement class describes a compiled function for
00055 // describing spectral profile.
00056 // </synopsis>
00057 //
00058 // <example>
00059 // </example>
00060 //
00061 // <motivation>
00062 // To have a container for data describing a compiled function for
00063 // describing a spectral profile for fitting to an observed spectrum
00064 // </motivation>
00065 
00066 class CompiledSpectralElement: public SpectralElement {
00067 public:
00068 
00069         // Construct a compiled string
00070         explicit CompiledSpectralElement(
00071                 const String& function, const Vector<Double>& param
00072         );
00073 
00074         CompiledSpectralElement(const CompiledSpectralElement& other);
00075 
00076         virtual ~CompiledSpectralElement();
00077 
00078         SpectralElement* clone() const;
00079 
00080         CompiledSpectralElement &operator=(
00081                 const CompiledSpectralElement& other
00082         );
00083         // Evaluate the value of the element at x
00084         virtual Double operator()(const Double x) const;
00085 
00086 
00087         // Get the string of a compiled functional
00088         const String& getFunction() const;
00089         // </group>
00090 
00091         // Save to a record.
00092         virtual Bool toRecord(RecordInterface& out) const;
00093 
00094 protected:
00095 
00096         CompiledSpectralElement();
00097 
00098         virtual void _setFunction(const String& function);
00099 
00100 private:
00101         // The string value for compiled functional
00102         String _function;
00103 };
00104 
00105 //# Global functions
00106 // <summary> Global functions </summary>
00107 // <group name=Output>
00108 // Output declaration
00109 ostream &operator<<(ostream &os, const CompiledSpectralElement &elem);
00110 // </group>
00111 
00112 
00113 } //# NAMESPACE CASA - END
00114 
00115 #endif
00116