ConvolutionTVI.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 #ifndef ConvolutionTVI_H_
00024 #define ConvolutionTVI_H_
00025 
00026 
00027 #include <mstransform/TVI/FreqAxisTVI.h>
00028 
00029 
00030 namespace casa { 
00031 
00032 namespace vi { 
00033 
00035 
00037 
00038 class ConvolutionTVI : public FreqAxisTVI
00039 {
00040 
00041 public:
00042 
00043         ConvolutionTVI( ViImplementation2 * inputVii,
00044                                         const Record &configuration);
00045 
00046     void flag(Cube<Bool>& flagCube) const;
00047     void floatData (Cube<Float> & vis) const;
00048     void visibilityObserved (Cube<Complex> & vis) const;
00049     void visibilityCorrected (Cube<Complex> & vis) const;
00050     void visibilityModel (Cube<Complex> & vis) const;
00051     void weightSpectrum(Cube<Float> &weightSp) const;
00052     void sigmaSpectrum (Cube<Float> &sigmaSp) const;
00053 
00054     Bool weightSpectrumExists () const {return True;}
00055     Bool sigmaSpectrumExists () const {return True;}
00056 
00057 protected:
00058 
00059     Bool parseConfiguration(const Record &configuration);
00060     void initialize();
00061 
00062     mutable Vector<Float> convCoeff_p;
00063 };
00064 
00066 
00068 
00069 class ConvolutionTVIFactory : public ViFactory
00070 {
00071 
00072 public:
00073 
00074         ConvolutionTVIFactory(Record &configuration,ViImplementation2 *inputVII);
00075 
00076 protected:
00077 
00078         vi::ViImplementation2 * createVi (VisibilityIterator2 *) const;
00079         vi::ViImplementation2 * createVi () const;
00080 
00081         Record configuration_p;
00082         ViImplementation2 *inputVii_p;;
00083 };
00084 
00086 
00088 
00089 
00090 template<class T> class ConvolutionKernel; 
00091 
00092 template<class T> class ConvolutionTransformEngine : public FreqAxisTransformEngine<T>
00093 {
00094 
00095 public:
00096 
00097         ConvolutionTransformEngine(ConvolutionKernel<T> *kernel, uInt width);
00098 
00099         void transform(Vector<T> &inputVector,Vector<T> &outputVector);
00100 
00101 protected:
00102 
00103         uInt width_p;
00104         
00105         
00106         
00107         ConvolutionKernel<T> *convolutionKernel_p;
00108 };
00109 
00111 
00113 
00114 template<class T> class ConvolutionKernel
00115 {
00116 
00117 public:
00118 
00119         ConvolutionKernel(Vector<Float> *convCoeff);
00120 
00121         virtual void kernel(    Vector<T> &inputVector,
00122                                                         Vector<T> &outputVector,
00123                                                         uInt startInputPos,
00124                                                         uInt outputPos) = 0;
00125 
00126 protected:
00127 
00128         uInt width_p;
00129         Vector<Float> *convCoeff_p;
00130 
00131 };
00132 
00134 
00136 
00137 template<class T> class ConvolutionDataKernel : public ConvolutionKernel<T>
00138 {
00139         using ConvolutionKernel<T>::width_p;
00140         using ConvolutionKernel<T>::convCoeff_p;
00141 
00142 public:
00143 
00144         ConvolutionDataKernel(Vector<Float> *convCoeff);
00145 
00146         void kernel(    Vector<T> &inputVector,
00147                                         Vector<T> &outputVector,
00148                                         uInt startInputPos,
00149                                         uInt outputPos);
00150 };
00151 
00153 
00155 
00156 template<class T> class ConvolutionLogicalORKernel : public ConvolutionKernel<T>
00157 {
00158 
00159         using ConvolutionKernel<T>::width_p;
00160         using ConvolutionKernel<T>::convCoeff_p;
00161 
00162 public:
00163 
00164         ConvolutionLogicalORKernel(Vector<Float> *convCoeff);
00165 
00166         void kernel(    Vector<T> &inputVector,
00167                                         Vector<T> &outputVector,
00168                                         uInt startInputPos,
00169                                         uInt outputPos);
00170 };
00171 
00173 
00175 
00176 template<class T> class ConvolutionWeightPropagationKernel : public ConvolutionKernel<T>
00177 {
00178 
00179         using ConvolutionKernel<T>::width_p;
00180         using ConvolutionKernel<T>::convCoeff_p;
00181 
00182 public:
00183 
00184         ConvolutionWeightPropagationKernel(Vector<Float> *convCoeff);
00185 
00186         void kernel(    Vector<T> &inputVector,
00187                                         Vector<T> &outputVector,
00188                                         uInt startInputPos,
00189                                         uInt outputPos);
00190 };
00191 
00192 
00193 } 
00194 
00195 } 
00196 
00197 #endif 
00198