MultiTermFT.h
Go to the documentation of this file.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_MULTITERMFT_H
00030 #define SYNTHESIS_MULTITERMFT_H
00031
00032 #include <synthesis/TransformMachines/FTMachine.h>
00033 #include <casa/Arrays/Matrix.h>
00034 #include <scimath/Mathematics/FFTServer.h>
00035 #include <msvis/MSVis/VisBuffer.h>
00036 #include <images/Images/ImageInterface.h>
00037 #include <images/Images/ImageInterface.h>
00038 #include <casa/Containers/Block.h>
00039 #include <casa/Arrays/Array.h>
00040 #include <casa/Arrays/Vector.h>
00041 #include <casa/Arrays/Matrix.h>
00042 #include <scimath/Mathematics/ConvolveGridder.h>
00043 #include <lattices/Lattices/LatticeCache.h>
00044 #include <lattices/Lattices/ArrayLattice.h>
00045
00046 #include <casa/OS/Timer.h>
00047
00048 namespace casa {
00049
00050 class UVWMachine;
00051
00052 class MultiTermFT : public FTMachine {
00053 public:
00054
00055
00056 MultiTermFT(FTMachine *subftm, String subFTMname, Int nterms=1, Double reffreq=0.0);
00057
00058
00059 MultiTermFT(const RecordInterface& stateRec);
00060
00061
00062
00063 MultiTermFT(const MultiTermFT &other);
00064
00065
00066 MultiTermFT &operator=(const MultiTermFT &other);
00067
00068
00069 ~MultiTermFT();
00070
00071
00072
00073 void initializeToVis(ImageInterface<Complex>& image, const VisBuffer& vb);
00074
00075
00076 void finalizeToVis();
00077
00078
00079 void initializeToSky(ImageInterface<Complex>& image, Matrix<Float>& weight, const VisBuffer& vb);
00080
00081
00082 void finalizeToSky();
00083
00084
00085 void get(VisBuffer& vb, Int row=-1);
00086
00087
00088 void put(VisBuffer& vb, Int row=-1, Bool dopsf=False,
00089 FTMachine::Type type=FTMachine::OBSERVED);
00090
00091
00092 void put(const VisBuffer& , Int , Bool ,
00093 FTMachine::Type )
00094 {throw(AipsError("MultiTermFT::put called with a const vb. This FTM needs to modify the vb."));};
00095
00096
00097
00098 virtual void ComputeResiduals(VisBuffer&vb, Bool useCorrected);
00099
00100
00101 void makeImage(FTMachine::Type type,
00102 VisSet& vs,
00103 ImageInterface<Complex>& image,
00104 Matrix<Float>& weight);
00105
00106
00107
00108
00109
00110 ImageInterface<Complex>& getImage(Matrix<Float>&, Bool normalize=True);
00111
00112
00113 virtual void normalizeImage(Lattice<Complex>& ,
00114 const Matrix<Double>& ,
00115 Lattice<Float>& ,
00116 Bool )
00117 {throw(AipsError("MultiTermFT::normalizeImage() is not implemented"));}
00118
00119
00120 void getWeightImage(ImageInterface<Float>&, Matrix<Float>&);
00121
00122
00123 virtual Bool toRecord(String& error, RecordInterface& outRec, Bool withImage=False, const String diskimage="");
00124 virtual Bool fromRecord(String& error, const RecordInterface& inRec);
00125
00126
00127 virtual Bool isFourier() {return True;}
00128 virtual void setNoPadding(Bool nopad){subftm_p->setNoPadding(nopad);};
00129 virtual String name() const {return machineName_p;};
00130 virtual void setMiscInfo(const Int qualifier){thisterm_p=qualifier;};
00131
00132 protected:
00133
00134
00135 Bool modifyVisWeights(VisBuffer& vb);
00136
00137 Bool modifyModelVis(VisBuffer &vb);
00138
00139 Bool restoreImagingWeights(VisBuffer &vb);
00140
00141 virtual void initMaps(const VisBuffer& vb);
00143 CountedPtr<FTMachine> subftm_p;
00144 String subFTMname_p;
00145 Int nterms_p;
00146 Int thisterm_p;
00147 Double reffreq_p;
00148
00149 Matrix<Float> imweights_p;
00150 Double sumwt_p;
00151 String machineName_p;
00152
00153 Bool dbg_p,dotime_p;
00154 Timer tmr_p;
00155 Double time_get, time_put, time_res;
00156 };
00157
00158 }
00159
00160 #endif