casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PBMath1DIPoly.h
Go to the documentation of this file.
00001 //# PBMath1DIPoly.h: Definitions of 1-D Inverse Polynomial PBMath objects
00002 //# Copyright (C) 1996,1997,1998,2003
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 adressed 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$
00028 
00029 #ifndef SYNTHESIS_PBMATH1DIPOLY_H
00030 #define SYNTHESIS_PBMATH1DIPOLY_H
00031 
00032 #include <casa/aips.h>
00033 #include <synthesis/TransformMachines/PBMath1D.h>
00034 #include <measures/Measures.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 //#forward
00039 
00040 // <summary> 
00041 // PBMath1DIPoly is a 1-D Inverse Polynomial Expansion for a Primary Beam
00042 // </summary>
00043 
00044 // <use visibility=export>
00045 
00046 // <reviewed reviewer="" date="" tests="" demos="">
00047 
00048 // <prerequisite>
00049 // <li> <linkto class="PBMathInterface">PBMathInterface</linkto> class
00050 // <li> <linkto class="PBMath1D">PBMath1D</linkto> class
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // PBMath1DIPoly: derived from  PBMath1D, implements an Inverse Polynomial PB and VP
00055 // </etymology>
00056 //
00057 // <synopsis> 
00058 //  See PBMath1D for a general synopsis of the 1D PB types.
00059 //
00060 // VP(x) = sum_i  coeff_i *  x ^{2i}, 
00061 // out to maximumRadius (referenced to the reference frequency)
00062 // 
00063 // x is in arcminutes, referenced to the reference frequency
00064 //
00065 // This move may make me a bit unpopular: since the PBMath1D constructors
00066 // construct a Voltage Pattern, the coeficienct for a polynomial type must
00067 // be in terms of the VP, not the PB.  Hence, go back to the original PB
00068 // data, take the square root, and fit the same type polynomial to the
00069 // VP data.
00070 //
00071 // Inverse polynomial VP model: fit polynomial to 1/(VP_data).
00072 // Optionally, you can fit to 1/(VP_data) - 1, ignoring the constant
00073 // polynomial term so that the PB is constrained to be 1.0 at the beam
00074 // center.
00075 // </synopsis> 
00076 //
00077 //
00078 // <example>
00079 // <srcblock>
00080 //    coef(0) = 1.0;     / VLA model
00081 //    coef(1) = 7.22110e-04; 
00082 //    coef(2) = 1.21421e-07;
00083 //    coef(3) = 9.68612e-11; 
00084 //    coef(4) = 1.86268e-13;
00085 //    PBMath1DIPoly ipolyPB( coef, Quantity(43.0,"'"), Quantity(1.0,"GHz"));
00086 //
00087 // </srcblock>
00088 // </example>
00089 //
00090 // <motivation>
00091 // All of the 1-D PB types have everything in common except for the
00092 // details of their parameterization.  This lightweight class
00093 // deals with those differences: construction, filling the PBArray
00094 // from construction parameters, and flushing to disk.
00095 // The inverse polynomial PB type is used for VLA and ATNF models.
00096 // </motivation>
00097 //
00098 // <todo asof="98/10/21">
00099 // <li> constructor from a MS beam subtable
00100 // <li> flush to MS beam subtable
00101 // </todo>
00102 
00103  
00104 class PBMath1DIPoly : public PBMath1D {
00105 public:
00106 
00107   PBMath1DIPoly() {};
00108 
00109   // Instantiation from arguments; default = no squint
00110   // squint is the offset from pointing center if the Stokes R beam
00111   // useSymmetricBeam forces a fit to the squinted beam
00112   PBMath1DIPoly(const Vector<Double>& coeff, Quantity maxRad, 
00113                 Quantity refFreq, 
00114                 Bool isThisVP=False,
00115                 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00116                                                         Quantity(0.0, "deg"),
00117                                                         MDirection::Ref(MDirection::AZEL)),
00118                                              Quantity(1.0, "GHz")),
00119                 Bool useSymmetricBeam=False);
00120 
00121   // Instantiation from a row in the Beam subTable
00122   // PBMath1DIPoly(const Table& BeamSubTable, Int row,
00123   //           Bool useSymmetricBeam=False);
00124 
00125   // Copy constructor
00126   // PBMath1DIPoly(const PBMath1DIPoly& other);
00127 
00128   // Assignment operator, by reference
00129   PBMath1DIPoly& operator=(const PBMath1DIPoly& other);
00130 
00131   // Clone the object
00132   //  CountedPtr<PBMathInterface> clone();
00133 
00134 
00135   ~PBMath1DIPoly();  
00136 
00137   // Get the type of PB this is
00138   PBMathInterface::PBClass whichPBClass() { return PBMathInterface::IPOLY; }  
00139 
00140   // Flush the construction parameters to disk
00141   // Bool flushToTable(Table& beamSubTable, Int iRow);
00142 
00143   // Summarize the construction data for this primary beam
00144   void summary(Int nValues=0);
00145 
00146 protected:
00147 
00148   // Fill in vp_p array from construction parameters
00149   void fillPBArray();
00150 
00151 private:    
00152 
00153   Vector<Double> coeff_p;
00154 
00155 };
00156 
00157 
00158 } //# NAMESPACE CASA - END
00159 
00160 #endif