casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PBMath1DPoly.h
Go to the documentation of this file.
00001 //# PBMath1DPoly.h: Definitions of 1-D 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_PBMATH1DPOLY_H
00030 #define SYNTHESIS_PBMATH1DPOLY_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 // PBMath1DPoly is a 1-D 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
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // PBMath1DPoly: derived from  PBMath1D, implements an Polynomial PB and VP
00055 // </etymology>
00056 //
00057 // <synopsis> 
00058 // PBMath1DPoly: a voltage pattern expressed as a
00059 // polynomial of even powers of x:
00060 // 
00061 // VP(x) = sum_i  coeff_i *  x ^{2i}
00062 // out to maximumRadius (referenced to the reference frequency)
00063 // 
00064 // x is in arcminutes, referenced to the reference frequency
00065 //
00066 // This move may make me a bit unpopular: since the PBMath1D constructors
00067 // construct a Voltage Pattern, the coeficienct for a polynomial type must
00068 // be in terms of the VP, not the PB.  Hence, go back to the original PB
00069 // data, take the square root, and fit the same type polynomial to the
00070 // VP data.
00071 // </synopsis> 
00072 //
00073 //
00074 // <example>
00075 // <srcblock>
00076 // </srcblock>
00077 // </example>
00078 //
00079 // <motivation>
00080 // All of the 1-D PB types have everything in common except for the
00081 // details of their parameterization.  This lightweight class
00082 // deals with those differences: construction, filling the PBArray
00083 // from construction parameters, and flushing to disk.  VLA and ATNF
00084 // PBs are tabulated in terms of polynimials.
00085 // </motivation>
00086 //
00087 // <todo asof="98/10/21">
00088 // <li> constructor from a MS beam subtable
00089 // <li> flush to MS beam subtable
00090 // </todo>
00091 
00092  
00093 class PBMath1DPoly : public PBMath1D {
00094 public:
00095 
00096   PBMath1DPoly();
00097 
00098   // Instantiation from arguments; default = no squint
00099   // squint is the offset from pointing center if the Stokes R beam
00100   // useSymmetricBeam forces a fit to the squinted beam
00101   PBMath1DPoly(const Vector<Double>& coeff, Quantity maxRad, 
00102                Quantity refFreq, 
00103                Bool isThisVP=False,
00104                BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00105                                                        Quantity(0.0, "deg"),
00106                                                        MDirection::Ref(MDirection::AZEL)),
00107                                             Quantity(1.0, "GHz")),
00108                Bool useSymmetricBeam=False);
00109 
00110   // Instantiation from a row in the Beam subTable
00111   //PBMath1DPoly(const Table& BeamSubTable, Int row,
00112   //           Bool useSymmetricBeam=False);
00113 
00114   // Copy constructor
00115   // PBMath1DPoly(const PBMath1DPoly& other);
00116 
00117   // Assignment operator, by reference
00118   PBMath1DPoly& operator=(const PBMath1DPoly& other);
00119 
00120   // Clone the object
00121   //  CountedPtr<PBMathInterface> clone();
00122 
00123   // Destructor
00124   ~PBMath1DPoly();  
00125 
00126   // Get the type of PB this is
00127   PBMathInterface::PBClass whichPBClass() { return PBMathInterface::POLY; }  
00128 
00129   // Flush the construction parameters to disk
00130   // Bool flushToTable(Table& beamSubTable, Int iRow);
00131 
00132   // Summarize the construction data for this primary beam
00133   void summary(Int nValues=0);
00134 
00135 protected:
00136 
00137   // Fill in vp_p array from construction parameters
00138   void fillPBArray();
00139 
00140 private:    
00141 
00142   Vector<Double> coeff_p;
00143 
00144 };
00145 
00146 
00147 } //# NAMESPACE CASA - END
00148 
00149 #endif