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 #ifndef SYNTHESIS_TRANSFORM2_VLACALCILLUMINATIONCONVFUNC_H
00030 #define SYNTHESIS_TRANSFORM2_VLACALCILLUMINATIONCONVFUNC_H
00031
00032 #include <synthesis/TransformMachines2/IlluminationConvFunc.h>
00033
00034 #include <synthesis/TransformMachines/BeamCalc.h>
00035
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/VisBuffer2.h>
00041 #include <casa/sstream.h>
00042 #include <synthesis/TransformMachines2/Utils.h>
00043 namespace casa{
00044 namespace refim{
00045 using namespace vi;
00046
00047 class VLACalcIlluminationConvFunc: public IlluminationConvFunc
00048 {
00049 public:
00050
00051 VLACalcIlluminationConvFunc();
00052 VLACalcIlluminationConvFunc(Int n):
00053 IlluminationConvFunc(n),
00054 convFunc_p(),resolution(),pbRead_p(False),freq_p(0),lastPA(0),ap()
00055 {pbRead_p=False;};
00056 ~VLACalcIlluminationConvFunc() {delete ap.aperture;};
00057
00058 void setBandID(Int bandID) {ap.band=bandID;}
00059
00060
00061
00062 void loadFromImage(String &fileName);
00063 void getIdealConvFunc(Array<Complex>& buf);
00064
00065 void ftAperture(TempImage<Complex>& uvgrid, Bool makeMueller);
00066 void ftAperture(TempImage<Complex>& uvgrid, Int makeMuerller=0);
00067 void ftAperture() {ftAperture(convFunc_p); pbRead_p=True;};
00068 void storePB(String& fileName);
00069
00070 Bool pbReady() {return pbRead_p;}
00071
00072 CoordinateSystem makeUVCoords(CoordinateSystem& imageCoordSys,
00073 IPosition& shape, Double refFreq=-1.0);
00074 void regridAperture(CoordinateSystem& skyCS,
00075 IPosition& skyShape,
00076 TempImage<Complex>& uvGrid,
00077
00078 Double& pa,
00079 Bool doSquint=True,Int bandID=-1,Int muellerTerm=0 ,Double freqVal=-1.0);
00080 void regridAperture(CoordinateSystem& skyCS,
00081 IPosition& skyShape,
00082 TempImage<Complex>& uvGrid,
00083 const VisBuffer2 &vb,
00084 const Vector<Float>& paList,
00085 Bool doSquint, Int bandID);
00086 void regridApertureEngine(ApertureCalcParams& ap,
00087 const Int& inStokes);
00088 void setApertureParams(ApertureCalcParams& ap,
00089 const Float& Freq, const Float& pa,
00090 const Int& bandID,
00091 const Int& inStokes,
00092 const IPosition& skyShape,
00093 const Vector<Double>& uvIncr);
00094
00095
00096 void applyPB(ImageInterface<Float>& pbImage, Double& pa,
00097 const Vector<Float>& paList, Int bandID, Bool doSquint=False);
00098 void applyPB(ImageInterface<Float>& pbImage, Double& pa,
00099 Int bandID=-1, Bool doSquint=False, Double freqVal=-1.0);
00100 void applyPB(ImageInterface<Complex>& pbImage, Double& pa,
00101 Bool doSquint=True,Int bandID=-1, Int muellerTerm=0, Double freqVal=-1.0);
00102 void applyPBSq(ImageInterface<Float>& pbImage, Double& pa,
00103 const Vector<Float>& paList, Int bandID, Bool doSquint=False);
00104 void applyPBSq(ImageInterface<Float>& pbImage, Double& pa,
00105 Int bandID=-1, Bool doSquint=False);
00106 void applyPBSq(ImageInterface<Complex>& pbImage, Double& pa,
00107 Int bandID=-1, Bool doSquint=True);
00108 void makeFullJones(ImageInterface<Complex>& pbImage, const VisBuffer2& vb, Bool doSquint,
00109 Int bandID, Double freqVal=-1.0);
00110 void skyMuller(ImageInterface<Complex>& skyJones);
00111 void skyMuller(ImageInterface<Complex>& skyJones, Int muellerTerm=0);
00112 void skyMuller(Array<Complex>& skyJones, const IPosition& shape, const Int& inStokes);
00113
00114 Bool findSupport(Array<Complex>& , Float& ,Int& , Int& )
00115 {throw(AipsError("VLACalcIlluminationConvFunc::findSupport() not implemented"));};
00116 virtual Bool makeAverageResponse(const VisBuffer2& ,
00117 const ImageInterface<Complex>& ,
00118
00119 ImageInterface<Float>& ,
00120 Bool =True)
00121 {throw(AipsError("VLACalc::makeAverageRes() called"));};
00122
00123
00124 private:
00125
00126 void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Float>& outImg, Bool Square=False);
00127 void fillPB(ImageInterface<Complex>& inImg, ImageInterface<Complex>& outImg, Bool Square=False);
00128
00129 TempImage<Complex> convFunc_p;
00130
00131 Vector<Double> resolution;
00132 Bool pbRead_p;
00133 Float freq_p,lastPA;
00134 ApertureCalcParams ap;
00135 };
00136 };
00137 };
00138 #endif