SimplePBConvFunc.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 #ifndef SYNTHESIS_SIMPLEPBCONVFUNC_H
00029 #define SYNTHESIS_SIMPLEPBCONVFUNC_H
00030
00031 #include <casa/Arrays/Vector.h>
00032 #include <synthesis/TransformMachines/PBMathInterface.h>
00033 #include <casa/Containers/Block.h>
00034 #include <casa/Utilities/CountedPtr.h>
00035 #include <msvis/MSVis/VisBufferUtil.h>
00036 #include <synthesis/Utilities/FFT2D.h>
00037 #include <wcslib/wcsconfig.h>
00039 #if HAVE_SINCOS
00040 #define SINCOS(a,s,c) sincos(a,&s,&c)
00041 #else
00042 #define SINCOS(a,s,c) \
00043 s = sin(a); \
00044 c = cos(a)
00045 #endif
00046
00047
00048 namespace casa{
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 template<class T> class ImageInterface;
00069 template<class T> class Matrix;
00070 class VisBuffer;
00071 class SkyJones;
00072 class CoordinateSystem;
00073 class DirectionCoordinate;
00074
00075 class SimplePBConvFunc
00076 {
00077 public:
00078 SimplePBConvFunc();
00079 SimplePBConvFunc(const PBMathInterface::PBClass typeToUse);
00080 SimplePBConvFunc(const RecordInterface& rec, Bool calcFlux_needed);
00081 virtual ~SimplePBConvFunc();
00082
00083
00084
00085
00086 virtual void findConvFunction(const ImageInterface<Complex>& ,
00087 const VisBuffer& ,const Int& ,
00088 SkyJones& ,
00089 Matrix<Complex>& ,
00090 Matrix<Complex>& , Int& ,
00091 Int& ){};
00092
00094
00095
00096
00097 virtual void findConvFunction(const ImageInterface<Complex>& iimage,
00098 const VisBuffer& vb,
00099 const Int& convSampling,
00100 const Vector<Double>& visFreq,
00101 Array<Complex>& convFunc,
00102 Array<Complex>& weightConvFunc,
00103 Vector<Int>& convsize,
00104 Vector<Int>& convSupport,
00105 Vector<Int>& polMap, Vector<Int>& chanMap, Vector<Int>& rowMap);
00106 virtual ImageInterface<Float>& getFluxScaleImage();
00107
00108 virtual void sliceFluxScale(Int npol);
00109
00110
00111 virtual void setWeightImage(CountedPtr<TempImage<Float> >& wgtimage);
00112
00113 virtual void setSkyJones(SkyJones* sj);
00114
00115 Bool findSupport(Array<Complex>& , Float& ,Int& , Int& )
00116 {throw(AipsError("SimplePBConvFunc::findSupport() not implemented"));};
00117 virtual Bool makeAverageResponse(const VisBuffer& ,
00118 const ImageInterface<Complex>& ,
00119 ImageInterface<Float>& ,
00120 Bool )
00121 {throw(AipsError("SimplePBConvFunc::makeAverageRes() called"));};
00122
00123
00124 virtual Bool toRecord(RecordInterface& outRec);
00125
00126
00127 virtual Bool fromRecord(String& err, const RecordInterface& rec, Bool calcFluxneeded=False);
00128
00129 virtual void reset();
00130 protected:
00131 SkyJones* sj_p;
00132 TempImage<Float> fluxScale_p;
00133 Int nx_p;
00134 Int ny_p;
00135 Int nchan_p;
00136 Int npol_p;
00137 CoordinateSystem csys_p;
00138 DirectionCoordinate dc_p;
00139 MDirection::Convert pointToPix_p;
00140 MeasFrame pointFrame_p;
00141 MEpoch::Types timeMType_p;
00142 Unit timeUnit_p;
00143 Int directionIndex_p;
00144 MDirection direction1_p;
00145 MDirection direction2_p;
00146 Vector<Double> thePix_p;
00147 Bool filledFluxScale_p;
00148 Vector<Bool> doneMainConv_p;
00149 Bool calcFluxScale_p;
00150 std::map<String, Int> vbConvIndex_p;
00151 virtual Int convIndex(const VisBuffer& vb);
00152 std::map<String, Int> ant1PointVal_p;
00153 Vector<MDirection> ant1PointingCache_p;
00154 const MDirection& pointingDirAnt1(const VisBuffer& vb);
00155 virtual void storeImageParams(const ImageInterface<Complex>& iimage, const VisBuffer& vb);
00156 virtual void findUsefulChannels(Vector<Int>& chanMap, Vector<Double>& chanFreqs, const VisBuffer& vb, const Vector<Double>& visFreq);
00157
00158 virtual void toPix(const VisBuffer& vb);
00159 FFT2D ft_p;
00160 CountedPtr<TempImage<Float> > convWeightImage_p;
00161 private:
00162 Bool checkPBOfField(const VisBuffer& vb);
00163 void addPBToFlux(const VisBuffer& vb);
00164 SimpleOrderedMap <String, Int> convFunctionMap_p;
00165 Int actualConvIndex_p;
00166 PBMathInterface::PBClass pbClass_p;
00167
00168 Matrix<Complex> convFunc_p;
00169 Matrix<Complex> weightConvFunc_p;
00170 Matrix<Complex> convSave_p;
00171 Matrix<Complex> weightSave_p;
00172 Int convSize_p;
00173 Int convSupport_p;
00174
00175
00176 Block <CountedPtr<Array<Complex> > > convFunctions_p;
00177 Block <CountedPtr<Array<Complex> > > convWeights_p;
00178 Block<CountedPtr<Vector<Int> > > convSizes_p;
00179 Block <CountedPtr<Vector<Int> > > convSupportBlock_p;
00180 Matrix<Bool> pointingPix_p;
00181 VisBufferUtil vbUtil_p;
00182
00183 };
00184 };
00185 #endif