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