casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PBMath1DCosPoly.h
Go to the documentation of this file.
00001 //# PBMath1DCosPoly.h: Definitions of 1-D CosPolynomial 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_PBMATH1DCOSPOLY_H
00030 #define SYNTHESIS_PBMATH1DCOSPOLY_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 // <summary> 
00039 // PBMath1DCosPoly is a 1-D Polynomial Cosine Expansion for a Primary Beam
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="" demos="">
00045 
00046 // <prerequisite>
00047 // <li> <linkto class="PBMathInterface">PBMathInterface</linkto> class
00048 // <li> <linkto class="PBMath1D">PBMath1D</linkto> class
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // PBMath1DCosPoly: derived from  PBMath1D, implements a polynomial of Cosines of different widths
00053 // </etymology>
00054 //
00055 // <synopsis> 
00056 // PBMath1DCosPoly: a voltage pattern expressed as a
00057 // polynomial of cosines (all powers of them):
00058 // 
00059 // VP(x) = sum_i  coeff_i * cos( scale_i * x )^{i}
00060 // 
00061 // x is in arcminutes, referenced to 1GHz frequency;
00062 // the argument of the cosines are in radians
00063 // </synopsis> 
00064 //
00065 //
00066 // <example>
00067 // <srcblock>
00068 //    Vector<Double> cosCoef(4);
00069 //    Vector<Double> cosScale(4);
00070 //    cosCoef.set(0.0);
00071 //    cosScale.set(0.0);
00072 //    cosCoef(3) = 1.0;
00073 //    cosScale(3) = 0.01891; // 0.01891 = 0.065 * 1000(MHz/GHz) /(60(arcm/deg)) * 2pi/180
00074 //    PBMath1DCosPoly cosPB(cosCoef, cosScale,
00075 //                          Quantity(1.0, "deg"), 
00076 //                          Quantity(1.0, "GHz")  );
00077 //    cosPB.applyPB( im3, im4, pointingDir);
00078 // </srcblock>
00079 // </example>
00080 //
00081 // <motivation>
00082 // All of the 1-D PB types have everything in common except for the
00083 // details of their parameterization.  This lightweight class
00084 // deals with those differences: construction, filling the PBArray
00085 // from construction parameters, and flushing to disk.
00086 // WSRT uses this model.
00087 // </motivation>
00088 //
00089 // <todo asof="98/10/21">
00090 // <li> constructor from a MS beam subtable
00091 // <li> flush to MS beam subtable
00092 // </todo>
00093 
00094  
00095 class PBMath1DCosPoly : public PBMath1D {
00096 public:
00097 
00098   PBMath1DCosPoly();
00099 
00100   // Instantiation from arguments; default = no squint
00101   // squint is the offset from pointing center if the Stokes R beam
00102   // useSymmetricBeam forces a fit to the squinted beam
00103   PBMath1DCosPoly(const Vector<Double>& coeff, 
00104                   const Vector<Double>& cosScale, Quantity maxRad, 
00105                   Quantity refFreq, 
00106                   Bool isThisVP=False,
00107                   BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00108                                                           Quantity(0.0, "deg"),
00109                                                           MDirection::Ref(MDirection::AZEL)),
00110                                                Quantity(1.0, "GHz")),
00111                   Bool useSymmetricBeam=False);
00112 
00113   // Instantiation from a row in the Beam subTable
00114   // PBMath1DCosPoly(const Table& BeamSubTable, Int row,
00115   //      Bool useSymmetricBeam=False);
00116 
00117   // Copy constructor
00118   // PBMath1DCosPoly(const PBMath1DCosPoly& other);
00119 
00120   // Assignment operator, by reference
00121   PBMath1DCosPoly& operator=(const PBMath1DCosPoly& other);
00122 
00123   // Clone the object
00124   //  CountedPtr<PBMathInterface> clone();
00125 
00126   // destructor
00127   ~PBMath1DCosPoly();
00128 
00129   // Get the type of PB this is
00130   PBMathInterface::PBClass whichPBClass() { return PBMathInterface::COSPOLY; }
00131 
00132   // Flush the construction parameters to disk
00133   // Bool flushToTable(Table& beamSubTable, Int iRow);
00134 
00135   // Summarize the construction data for this primary beam
00136   void summary(Int nValues=0);
00137 
00138 
00139 protected:
00140 
00141   // Fill in vp_p array from construction parameters
00142   void fillPBArray();
00143 
00144 private:    
00145 
00146   Vector<Double> coeff_p;
00147   Vector<Double> cosScale_p;
00148 
00149 };
00150 
00151 
00152 } //# NAMESPACE CASA - END
00153 
00154 #endif