00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef SYNTHESIS_ALMACALCILLUMINATIONCONVFUNC_H
00031 #define SYNTHESIS_ALMACALCILLUMINATIONCONVFUNC_H
00032
00033 #include <synthesis/TransformMachines/IlluminationConvFunc.h>
00034 #include <synthesis/TransformMachines/BeamCalc.h>
00035 #include <synthesis/TransformMachines/ALMAAperture.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 <msvis/MSVis/VisBuffer.h>
00041 #include <casa/sstream.h>
00042 #include <synthesis/TransformMachines/Utils.h>
00043 namespace casa{
00044
00045 class ALMACalcIlluminationConvFunc: public IlluminationConvFunc
00046 {
00047 public:
00048
00049 ALMACalcIlluminationConvFunc();
00050 ALMACalcIlluminationConvFunc(Int n):IlluminationConvFunc(n)
00051 {pbRead_p=False;};
00052 ~ALMACalcIlluminationConvFunc()
00053 {delete ap.aperture;};
00054
00055 void setBandID(Int ) {}
00056
00057 void setAntRayPath(const String& antRayPath) {otherAntRayPath_p = antRayPath;}
00058
00059 void loadFromImage(String &fileName);
00060 void getIdealConvFunc(Array<Complex>& buf);
00061 void ftAperture(TempImage<Complex>& uvgrid);
00062 void ftAperture() {ftAperture(convFunc_p); pbRead_p=True;};
00063 void storePB(String& fileName);
00064
00065 Bool pbReady() {return pbRead_p;}
00066
00067 CoordinateSystem makeUVCoords(CoordinateSystem& imageCoordSys,
00068 IPosition& shape, Double refFreq=-1.0);
00069 void regridAperture(CoordinateSystem& skyCS,
00070 IPosition& skyShape,
00071 TempImage<Complex>& uvGrid,
00072 const VisBuffer& vb,
00073 Bool doSquint=True,Int bandID=-1);
00074 void regridAperture(CoordinateSystem& skyCS,
00075 IPosition& skyShape,
00076 TempImage<Complex>& uvGrid,
00077 const VisBuffer &vb,
00078 const Vector<Float>& paList,
00079 Bool doSquint, Int bandID);
00080
00081 void regridAperture(CoordinateSystem& skyCS,
00082 IPosition& skyShape,
00083 TempImage<Complex>& uvGrid,
00084 const String& telescope,
00085 const MVFrequency& freqQ,
00086 Float pa = 0.,
00087 Bool doSquint=True,
00088 Int bandID=-1);
00089
00090 void applyPB(ImageInterface<Float>& pbImage,
00091 const VisBuffer& vb, Bool doSquint=False, Int cfKey=0);
00092
00093 void applyPB(ImageInterface<Complex>& pbImage,
00094 const VisBuffer& vb, Bool doSquint=True, Int cfKey=0);
00095
00096 void applyPB(ImageInterface<Float>& pbImage,
00097 const String& telescope, const MEpoch& obsTime,
00098 const String& antType0, const String& antType1,
00099 const MVFrequency& freqQ, Double pa=0.,
00100 Bool doSquint=False);
00101
00102 void applyPB(ImageInterface<Complex>& pbImage,
00103 const String& telescope, const MEpoch& obsTime,
00104 const String& antType0, const String& antType1,
00105 const MVFrequency& freqQ, Double pa=0.,
00106 Bool doSquint=True);
00107
00108 void applyVP(ImageInterface<Complex>& pbImage,
00109 const String& telescope, const MEpoch& obsTime,
00110 const String& antType0, const String& antType1,
00111 const MVFrequency& freqQ, Double pa=0.,
00112 Bool doSquint=True);
00113
00114 void skyMuller(ImageInterface<Complex>& skyJones);
00115
00116
00117 virtual void prepareConvFunction(const VisBuffer& , CFStore& ){};
00118
00119
00120
00121 private:
00122
00123 void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Float>& outImg, Bool Square=False);
00124 void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Complex>& outImg, Bool Square=False);
00125 void fillVP(ImageInterface<Complex>& inImg, ImageInterface<Complex>& outImg, Bool Square=False);
00126
00127 TempImage<Complex> convFunc_p;
00128 Vector<Double> resolution;
00129 Bool pbRead_p;
00130 Float freq_p,lastPA;
00131 ApertureCalcParams ap;
00132
00133 Bool haveCannedResponses;
00134
00135 String otherAntRayPath_p;
00136 };
00137
00138 };
00139 #endif