casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VLACalcIlluminationConvFunc.h
Go to the documentation of this file.
00001 //# VLAIlluminationConvFunc.h: Definition for VLAIlluminationConvFunc
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2002
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_VLACALCILLUMINATIONCONVFUNC_H
00030 #define SYNTHESIS_VLACALCILLUMINATIONCONVFUNC_H
00031 
00032 #include <synthesis/TransformMachines/IlluminationConvFunc.h>
00033 //#include <synthesis/MeasurementComponents/BeamCalcConstants.h>
00034 #include <synthesis/TransformMachines/BeamCalc.h>
00035 //#include <synthesis/MeasurementComponents/BeamCalcAntenna.h>
00036 #include <synthesis/MeasurementComponents/CExp.new3.h>
00037 #include <synthesis/MeasurementComponents/ExpCache.h>
00038 #include <images/Images/TempImage.h>
00039 #include <casa/Exceptions.h>
00040 #include <synthesis/MSVis/VisBuffer.h>
00041 #include <casa/sstream.h>
00042 #include <synthesis/TransformMachines/Utils.h>
00043 namespace casa{
00044 
00045   //  Int getVLABandID(Double& freq,String&telescopeName);
00046   class VLACalcIlluminationConvFunc: public IlluminationConvFunc
00047   {
00048   public:
00049 
00050     VLACalcIlluminationConvFunc();
00051     VLACalcIlluminationConvFunc(Int n):IlluminationConvFunc(n)    {pbRead_p=False;};
00052     ~VLACalcIlluminationConvFunc() {delete ap.aperture;};
00053 
00054     void setBandID(Int bandID) {ap.band=bandID;}
00055     // void storeImg(String &fileName,ImageInterface<Complex>& img);
00056     // void storeImg(String &fileName,ImageInterface<Float>& img);
00057     // void store(String &fileName);
00058     void loadFromImage(String &fileName);
00059     void getIdealConvFunc(Array<Complex>& buf);
00060     void ftAperture(TempImage<Complex>& uvgrid);
00061     void ftAperture() {ftAperture(convFunc_p); pbRead_p=True;};
00062     void storePB(String& fileName);
00063 
00064     Bool pbReady() {return pbRead_p;}
00065 
00066     CoordinateSystem makeUVCoords(CoordinateSystem& imageCoordSys,
00067                                   IPosition& shape, Double refFreq=-1.0);
00068     void regridAperture(CoordinateSystem& skyCS, 
00069                         IPosition& skyShape, 
00070                         TempImage<Complex>& uvGrid, 
00071                         const VisBuffer& vb,
00072                         Bool doSquint=True,Int bandID=-1, Double freqVal=-1);
00073     void regridAperture(CoordinateSystem& skyCS,
00074                         IPosition& skyShape,
00075                         TempImage<Complex>& uvGrid,
00076                         const VisBuffer &vb,
00077                         const Vector<Float>& paList,
00078                         Bool doSquint, Int bandID);
00079     void applyPB(ImageInterface<Float>& pbImage, const VisBuffer& vb, 
00080                  const Vector<Float>& paList, Int bandID, Bool doSquint=False);
00081     void applyPB(ImageInterface<Float>& pbImage, const VisBuffer& vb, Int bandID=-1, 
00082                  Bool doSquint=False, Double freqVal=-1);
00083     void applyPB(ImageInterface<Complex>& pbImage, const VisBuffer& vb, Int bandID=-1, 
00084                  Bool doSquint=True, Double freqVal=-1);
00085     void applyPBSq(ImageInterface<Float>& pbImage, const VisBuffer& vb, 
00086                    const Vector<Float>& paList, Int bandID, Bool doSquint=False);
00087     void applyPBSq(ImageInterface<Float>& pbImage, const VisBuffer& vb, Int bandID=-1, 
00088                    Bool doSquint=False);
00089     void applyPBSq(ImageInterface<Complex>& pbImage, const VisBuffer& vb, Int bandID=-1, 
00090                    Bool doSquint=True);
00091     void skyMuller(ImageInterface<Complex>& skyJones);
00092     Bool findSupport(Array<Complex>& /*func*/, Float& /*threshold*/,Int& /*origin*/, Int& /*R*/)
00093     {throw(AipsError("VLACalcIlluminationConvFunc::findSupport() not implemented"));};
00094     virtual Bool makeAverageResponse(const VisBuffer& /*vb*/,
00095                                      const ImageInterface<Complex>& /*image*/,
00096                                      //                              TempImage<Float>& theavgPB,
00097                                      ImageInterface<Float>& /*theavgPB*/,
00098                                      Bool /*reset*/=True)
00099     {throw(AipsError("VLACalc::makeAverageRes() called"));};
00100 
00101 
00102   private:
00103     
00104     void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Float>& outImg, Bool Square=False);
00105     void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Complex>& outImg, Bool Square=False);
00106 
00107     TempImage<Complex> convFunc_p;
00108     //    TempImage<Float> reAperture_p, imAperture_p;
00109     Vector<Double> resolution;
00110     Bool pbRead_p;
00111     Float freq_p,lastPA;
00112     ApertureCalcParams ap;
00113   };
00114 
00115 };
00116 #endif