casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PBMath1DNumeric.h
Go to the documentation of this file.
00001 //# PBMath1DNumeric.h: Definitions of 1-D Numeric PBMath objects
00002 //# Copyright (C) 1996,1997,1998,2000,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_PBMATH1DNUMERIC_H
00030 #define SYNTHESIS_PBMATH1DNUMERIC_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> 1-D Numeric Primary Beam Model </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 //  PBMath1DNumeric: derived from  PBMath1D, implements a numeric PB and VP
00053 // </etymology>
00054 //
00055 // <synopsis> 
00056 // See PBMath1D for a general synopsis of the 1D PB types.
00057 // 
00058 // The user supplies a vector which is a numerical representation
00059 // of a voltage [attern (hey, if you have a PB, just take the square
00060 // root, and look out for sidelobes which could be negative).
00061 // The first element in the vector needs to be 1.0, the center of the
00062 // voltage pattern.  The last element of the vector is the value of the
00063 // VP at the maximumRadius.  The maximumRadius and the reference frequency at
00064 // which the tabulated VP is intended are also required for construction.
00065 // The PBMath1DNumeric constructor proceeds by performing SINC interpolation
00066 // on the input vector to generate the highly oversampled lookup vector.
00067 // 
00068 // </synopsis> 
00069 //
00070 //
00071 // <example>
00072 // <srcblock>
00073 //    Vector<Float> vp(10);
00074 //    vp(0) = 1.0f;
00075 //    vp(1) = 0.932f;
00076 //    vp(2) = 0.7462f;
00077 //    vp(3) = 0.4914f;
00078 //    vp(4) = 0.2308f;
00079 //    vp(5) = 0.02183f;   // first null
00080 //    vp(6) = -0.1005f;
00081 //    vp(7) = -0.1318f;
00082 //    vp(8) = -0.09458f;
00083 //    vp(9) = -0.0269f;
00084 //    Quantity maxRad(1.032,"deg");  
00085 //    Quantity refFreq(1.414, "GHz");
00086 //    PBMath1DNumeric numPB (vp, maxRad, refFreq);
00087 //    numPB.applyPB( im1, im2, pointingDir);
00088 // </srcblock>
00089 // </example>
00090 //
00091 // <motivation>
00092 // All of the 1-D PB types have everything in common except for the
00093 // details of their parameterization.  This lightweight class
00094 // deals with those differences: construction, filling the PBArray
00095 // from construction parameters, and flushing to disk.
00096 // The Numeric type is very handy: someone can take a sample
00097 // illumination pattern, FT, and take a slice of the resulting voltage
00098 // pattern and construct a Numerical VP from that slice.
00099 // </motivation>
00100 //
00101 // <todo asof="98/10/21">
00102 // <li> constructor from a MS beam subtable
00103 // <li> flush to MS beam subtable
00104 // </todo>
00105 
00106  
00107 class PBMath1DNumeric : public PBMath1D {
00108 public:
00109 
00110   PBMath1DNumeric();
00111 
00112   // Instantiation from arguments; default = no squint
00113   // squint is the offset from pointing center if the Stokes R beam
00114   // useSymmetricBeam forces a fit to the squinted beam
00115   PBMath1DNumeric(const Vector<Float>& numericArray, Quantity maxRad, Quantity refFreq, 
00116                   Bool isThisVP=False,
00117                   BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00118                                                           Quantity(0.0, "deg"),
00119                                                           MDirection::Ref(MDirection::AZEL)),
00120                                                Quantity(1.0, "GHz")),
00121                   Bool useSymmetricBeam=False);
00122 
00123   // Instantiation from a row in the Beam subTable
00124   // PBMath1DNumeric(const Table& BeamSubTable, Int row, 
00125   //    Bool useSymmetricBeam=False);
00126 
00127   // Copy constructor
00128   // PBMath1DGNumeric(const PBMath1DNumeric& other);
00129 
00130   // Assignment operator, by reference
00131   PBMath1DNumeric& operator=(const PBMath1DNumeric& other);
00132 
00133   //destructor
00134  ~PBMath1DNumeric();  
00135 
00136   // Get the type of PB this is
00137   PBMathInterface::PBClass whichPBClass() { return PBMathInterface::NUMERIC; }  
00138   
00139   // Flush the construction parameters to disk
00140   // Bool flushToTable(Table& beamSubTable, Int iRow);
00141 
00142   // Summarize the construction data for this primary beam
00143   void summary(Int nValues=0);
00144 
00145 protected:
00146 
00147   // Fill in vp_p array from construction parameters
00148   void fillPBArray();
00149 
00150 private:    
00151 
00152  Vector<Float> numericArray_p;
00153 
00154 };
00155 
00156 
00157 } //# NAMESPACE CASA - END
00158 
00159 #endif