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