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_ATERM_H
00030 #define SYNTHESIS_TRANSFORM2_ATERM_H
00031
00032
00033 #include <casa/Arrays/Vector.h>
00034 #include <casa/System/Casarc.h>
00035 #include <images/Images/ImageInterface.h>
00036 #include <images/Images/PagedImage.h>
00037 #include <images/Images/TempImage.h>
00038 #include <msvis/MSVis/VisBuffer2.h>
00039 #include <casa/Containers/Block.h>
00040 #include <synthesis/TransformMachines2/CFTerms.h>
00041 #include <synthesis/TransformMachines2/CFStore.h>
00042 #include <synthesis/TransformMachines2/CFStore2.h>
00043 #define CONVSIZE (1024*2)
00044 #define CONVWTSIZEFACTOR 1
00045 #define OVERSAMPLING 20
00046 #define THRESHOLD 1E-4
00047
00048 namespace casa{
00049 namespace refim{
00050 using namespace vi;
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 class ATerm: public CFTerms
00066 {
00067 public:
00068 ATerm ();
00069 virtual ~ATerm () {};
00070
00071 virtual String name() = 0;
00072
00073 virtual void makeFullJones(ImageInterface<Complex>& pbImage,
00074 const VisBuffer2& vb,
00075 Bool doSquint, Int& bandID, Double freqVal)=0;
00076
00077 virtual void applySky(ImageInterface<Float>& outputImages,
00078 const VisBuffer2& vb,
00079 const Bool doSquint=True,
00080 const Int& cfKey=0,
00081 const Int& muellerTerm=0,
00082 const Double freqVal=-1.0) = 0;
00083 virtual void applySky(ImageInterface<Complex>& outputImages,
00084 const VisBuffer2& vb,
00085 const Bool doSquint=True,
00086 const Int& cfKey=0,
00087 const Int& muellerTerm=0,
00088 const Double freqVal=-1.0) = 0;
00089 virtual void applySky(ImageInterface<Complex>& outImages,
00090 const Double& pa,
00091 const Bool doSquint,
00092 const Int& cfKey,
00093 const Int& muellerTerm,
00094 const Double freqVal)=0;
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 virtual Int makePBPolnCoords(const VisBuffer2& vb,
00119 const Int& convSize,
00120 const Int& convSampling,
00121 const CoordinateSystem& skyCoord,
00122 const Int& skyNx, const Int& skyNy,
00123 CoordinateSystem& feedCoord)
00124 {
00125
00126 return makePBPolnCoords(vb.correlationTypes(), convSize, convSampling, skyCoord,
00127 skyNx, skyNy, feedCoord);
00128 };
00129 virtual Int makePBPolnCoords(const Vector<Int>& vbCorrTypes,
00130 const Int& convSize,
00131 const Int& convSampling,
00132 const CoordinateSystem& skyCoord,
00133 const Int& skyNx, const Int& skyNy,
00134 CoordinateSystem& feedCoord);
00135
00136
00137 virtual Vector<Int> vbRow2CFKeyMap(const VisBuffer2& vb, Int& nUnique)
00138 {Vector<Int> tmp; tmp.resize(vb.nRows()); tmp=0; nUnique=1; return tmp;}
00139
00140 virtual void getPolMap(Vector<Int>& polMap) {polMap.resize(0); polMap = polMap_p_base;};
00141 virtual Vector<Int> getAntTypeList() {Vector<Int> tt(1);tt(0)=0;return tt;};
00142
00143 virtual void setConvSize(const Int convSize) {cachedConvSize_p=convSize;}
00144 virtual Int getConvSize() {return cachedConvSize_p;};
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 void setOversampling(const Int os) {cachedOverSampling_p=os;};
00157 virtual Int getOversampling() {return cachedOverSampling_p;}
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 virtual Float getConvWeightSizeFactor() {return CONVWTSIZEFACTOR;};
00169 virtual Float getSupportThreshold() {return THRESHOLD;};
00170
00171
00172
00173
00174
00175
00176
00177 virtual void normalizeImage(Lattice<Complex>& skyImage,
00178 const Matrix<Float>& weights)
00179 {
00180 (void)skyImage;(void)weights;
00181 throw(AipsError("Make ATerm::normalizeImage() pure virtual and implement in specializations"));
00182 };
00183
00184 virtual void cacheVBInfo(const VisBuffer2& vb) = 0;
00185 virtual void cacheVBInfo(const String& telescopeName, const Float& diameter)=0;
00186 virtual Int getBandID(const Double& freq, const String& telescopeName) = 0;
00187 virtual int getVisParams(const VisBuffer2& vb, const CoordinateSystem& skyCoord=CoordinateSystem()) = 0;
00188
00189
00190
00191
00192
00193
00194
00195
00196 virtual void setPolMap(const Vector<Int>& polMap) {polMap_p_base.resize(0);polMap_p_base=polMap;}
00197
00198 virtual void rotate(const VisBuffer2& vb, CFCell& cfc, const Double& rotAngleIncrement=5.0)=0;
00199 virtual void rotate2(const VisBuffer2& vb, CFCell& baseCFS, CFCell& cfc, const Double& rotAngleIncrement=5.0)=0;
00200 virtual Int mapAntIDToAntType(const Int& ) {return 0;};
00201 String getTelescopeName() {return telescopeName_p;};
00202 virtual Bool rotationallySymmetric() {return True;};
00203
00204 protected:
00205 LogIO& logIO() {return logIO_p;}
00206 LogIO logIO_p;
00207 Vector<Int> polMap_p_base;
00208 Int cachedOverSampling_p, cachedConvSize_p;
00209
00210 Float Diameter_p, Nant_p, HPBW, sigma;
00211 String telescopeName_p;
00212 };
00213 };
00214 };
00215
00216 #endif