ConvolutionTVI.h

Go to the documentation of this file.
00001 //# ConvolutionTVI.h: This file contains the interface definition of the MSTransformManager class.
00002 //#
00003 //#  CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
00004 //#  Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
00005 //#  Copyright (C) European Southern Observatory, 2011, All rights reserved.
00006 //#
00007 //#  This library is free software; you can redistribute it and/or
00008 //#  modify it under the terms of the GNU Lesser General Public
00009 //#  License as published by the Free software Foundation; either
00010 //#  version 2.1 of the License, or (at your option) any later version.
00011 //#
00012 //#  This library is distributed in the hope that it will be useful,
00013 //#  but WITHOUT ANY WARRANTY, without even the implied warranty of
00014 //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //#  Lesser General Public License for more details.
00016 //#
00017 //#  You should have received a copy of the GNU Lesser General Public
00018 //#  License along with this library; if not, write to the Free Software
00019 //#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00020 //#  MA 02111-1307  USA
00021 //# $Id: $
00022 
00023 #ifndef ConvolutionTVI_H_
00024 #define ConvolutionTVI_H_
00025 
00026 // Base class
00027 #include <mstransform/TVI/FreqAxisTVI.h>
00028 
00029 
00030 namespace casa { //# NAMESPACE CASA - BEGIN
00031 
00032 namespace vi { //# NAMESPACE VI - BEGIN
00033 
00035 // ConvolutionTVI class
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 // ConvolutionTVIFactory class
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 // ConvolutionTransformEngine class
00088 
00089 
00090 template<class T> class ConvolutionKernel; // Forward declaration
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         // This member has to be a pointer, otherwise there
00105         // are compile time problems due to the fact that
00106         // it is a pure virtual class.
00107         ConvolutionKernel<T> *convolutionKernel_p;
00108 };
00109 
00111 // ConvolutionKernel class
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 // ConvolutionDataKernel class
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 // ConvolutionLogicalORKernel class
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 // ConvolutionWeightPropagationKernel class
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 } //# NAMESPACE VI - END
00194 
00195 } //# NAMESPACE CASA - END
00196 
00197 #endif /* ConvolutionTVI_H_ */
00198 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1