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_LOGTRANSFORMEDPOLYNOMIALSPECTRALELEMENT_H 00030 #define COMPONENTS_LOGTRANSFORMEDPOLYNOMIALSPECTRALELEMENT_H 00031 00032 #include <components/SpectralComponents/PolynomialSpectralElement.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 // <summary> 00037 // Describes the often used for determining spectral index plus higher order terms: 00038 // y = log (S_x) = ln(c_0) + c_1*ln(x) + c_2*ln(x)**2 + c_3*ln(x)**3 + ... 00039 // where c_1 is the traditional spectral index (alpha). 00040 // </summary> 00041 00042 // <use visibility=export> 00043 00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tSpectralFit" demos=""> 00045 // </reviewed> 00046 00047 // <prerequisite> 00048 // <li> <linkto module=SpectralElement>SpectralElement</linkto> module 00049 // </prerequisite> 00050 // 00051 // <etymology> 00052 // From power law, logarithm, and polynomial and spectral line and element 00053 // </etymology> 00054 // 00055 // <synopsis> 00056 // Describes a function that can be used to fit for spectral index and higher order terms. 00057 // The implementation simply subclasses PolynomialSpectralElement since that's all this function 00058 // really is, whicht the exception the the lhs is ln(y) not y. This means it's the fitter 00059 // configurator's responsibility to pass in the ln of the actual ordinate values and the ln 00060 // of the abscissa values, not the ordinate and abscissa values themselves. Essentially, this 00061 // class differs from PolynomialSpectralElement in its type and its stream operator. 00062 00063 // </synopsis> 00064 // 00065 // <example> 00066 // </example> 00067 // 00068 // <motivation> 00069 // To have a spectral element representing a spectral index function. 00070 // </motivation> 00071 00072 00073 class LogTransformedPolynomialSpectralElement: public PolynomialSpectralElement { 00074 public: 00075 00076 // Constructor. The n coefficients c_i to be solved for are 00077 // c_0 + c_1 * ln(x) + c_2 * ln(x)**2 + c_3 * ln(x)**3 + ... c_(n-1)*ln(x)**(n-1) 00078 // where x = nu/nu0. <src> order</order> is the polynomial, so the actual 00079 // function will have order+1 coefficients 00080 explicit LogTransformedPolynomialSpectralElement(uInt order); 00081 00082 // Construct with the given parameters. See above constructor for 00083 // order in which the parameters should be supplied. 00084 LogTransformedPolynomialSpectralElement(const Vector<Double> ¶m); 00085 00086 // Copy constructor (deep copy) 00087 LogTransformedPolynomialSpectralElement(const LogTransformedPolynomialSpectralElement &other); 00088 00089 ~LogTransformedPolynomialSpectralElement(); 00090 00091 LogTransformedPolynomialSpectralElement &operator=( 00092 const LogTransformedPolynomialSpectralElement& other 00093 ); 00094 00095 SpectralElement* clone() const; 00096 }; 00097 ostream &operator<<( 00098 ostream &os, const LogTransformedPolynomialSpectralElement &elem 00099 ); 00100 00101 00102 } //# NAMESPACE CASA - END 00103 00104 #endif 00105