casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CFTerms.h
Go to the documentation of this file.
00001 //# CFTerms.h: Definition for CFTerms
00002 //# Copyright (C) 2007
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_CFTERMS_H
00030 #define SYNTHESIS_CFTERMS_H
00031 
00032 
00033 #include <casa/Arrays/Vector.h>
00034 #include <images/Images/ImageInterface.h>
00035 #include <images/Images/PagedImage.h>
00036 #include <images/Images/TempImage.h>
00037 #include <synthesis/MSVis/VisBuffer.h>
00038 #include <casa/Containers/Block.h>
00039 
00040 namespace casa{
00041   // <summary>  
00042   //  The base class to represent the Aperture-Term of the Measurement Equation. 
00043   // </summary>
00044   
00045   // <use visibility=export>
00046   // <prerequisite>
00047   // </prerequisite>
00048   // <etymology>
00049   //   A-Term to account for the effects of the antenna primary beam(s).
00050   // </etymology>
00051   //
00052   // <synopsis> 
00053   // 
00054   //</synopsis>
00055   class CFTerms
00056   {
00057   public:
00058     enum OpCodes {NOOP=0,NORMAL};
00059     CFTerms ():opCode_p(NORMAL) {};
00060     virtual ~CFTerms () {};
00061 
00062     virtual void setOpCode(OpCodes code) {opCode_p = code;}
00063     virtual Bool isNoOp() {return opCode_p==NOOP;};
00064 
00065     virtual String name() = 0;
00066 
00067     virtual void applySky(ImageInterface<Float>& outputImages,
00068                           const VisBuffer& vb, 
00069                           const Bool doSquint=True,
00070                           const Int& cfKey=0,
00071                           const Double freqVal=-1) = 0;
00072     virtual void applySky(ImageInterface<Complex>& outputImages,
00073                           const VisBuffer& vb, 
00074                           const Bool doSquint=True,
00075                           const Int& cfKey=0,
00076                           const Double freqVal=-1) = 0;
00077     //
00078     // Not sure if the following method is requried.  Leaving it in
00079     // the code for now with an implementation that does nothing.
00080     //
00081     // virtual void applySky(Matrix<Complex>& screen, const Int wPixel, 
00082     //                    const Vector<Double>& sampling,
00083     //                    const Int wConvSize, const Double wScale,
00084     //                    const Int inner) 
00085     // {(void)screen; (void)wPixel; (void)sampling; (void)wConvSize; (void)wScale; (void)inner;};
00086 
00087     //
00088     // Returns a vector of integers that map each row in the given
00089     // VisBuffer to an index that is used to pick the appropriate
00090     // convolution function plane.  It also returns the number of
00091     // unique baselines in the nUnique parameter (unique baselines are
00092     // defined as the number of baselines each requiring a unique
00093     // convolution function).
00094     //
00095     // This is required for Heterogeneous antenna arrays (like ALMA)
00096     // and for all arrays where not all antenna aperture illuminations
00097     // can be treated as identical.
00098     //
00099     virtual Vector<Int> vbRow2CFKeyMap(const VisBuffer& vb, Int& nUnique) = 0;
00100     virtual Int makePBPolnCoords(const VisBuffer& vb,
00101                                  const Int& convSize,
00102                                  const Int& convSampling,
00103                                  const CoordinateSystem& skyCoord,
00104                                  const Int& skyNx, const Int& skyNy,
00105                                  CoordinateSystem& feedCoord) = 0;
00106 
00107     virtual Int getConvSize() = 0;
00108     virtual Int getOversampling() = 0;
00109     virtual Float getConvWeightSizeFactor() = 0;
00110     virtual Float getSupportThreshold() = 0;
00111     
00112     virtual void normalizeImage(Lattice<Complex>& skyImage,
00113                                 const Matrix<Float>& weights) = 0;
00114 
00115     virtual int getVisParams(const VisBuffer& vb, const CoordinateSystem& skyCoord=CoordinateSystem()) = 0;
00116     //
00117     // The mapping from VisBuffer polarizations map to the Image plane
00118     // polarization.  The latter is determined by the user input,
00119     // which is passed to the FTMachine in Imager.cc
00120     //
00121     // The map is available in the FTMachine which uses this method to
00122     // set the map for the CFTerms object.
00123     //
00124     virtual void setPolMap(const Vector<Int>& polMap) {polMap_p_base.resize(0);polMap_p_base=polMap;}
00125     virtual void getPolMap(Vector<Int>& polMap) {polMap.resize(0); polMap = polMap_p_base;};
00126 
00127 
00128 
00129   protected:
00130     LogIO& logIO() {return logIO_p;}
00131     LogIO logIO_p;
00132     Vector<Int> polMap_p_base;
00133     OpCodes opCode_p;
00134   };
00135 
00136 };
00137 
00138 #endif