ChannelAverageTVI.h

Go to the documentation of this file.
00001 //# ChannelAverageTVI.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 ChannelAverageTVI_H_
00024 #define ChannelAverageTVI_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 // ChannelAverageTVI class
00037 
00038 class ChannelAverageTVI : public FreqAxisTVI
00039 {
00040 
00041 public:
00042 
00043         ChannelAverageTVI(ViImplementation2 * inputVii,const Record &configuration);
00044 
00045         // Report the the ViImplementation type
00046         virtual String ViiType() const { return String("ChannelAverage( ")+getVii()->ViiType()+" )"; };
00047 
00048 
00049     void flag(Cube<Bool>& flagCube) const;
00050     void floatData (Cube<Float> & vis) const;
00051     void visibilityObserved (Cube<Complex> & vis) const;
00052     void visibilityCorrected (Cube<Complex> & vis) const;
00053     void visibilityModel (Cube<Complex> & vis) const;
00054     void weightSpectrum(Cube<Float> &weightSp) const;
00055     void sigmaSpectrum (Cube<Float> &sigmaSp) const;
00056 
00057     Bool weightSpectrumExists () const {return True;}
00058     Bool sigmaSpectrumExists () const {return True;}
00059 
00060     Vector<Double> getFrequencies (     Double time, Int frameOfReference,
00061                                                                 Int spectralWindowId, Int msId) const;
00062 
00063     void writeFlag (const Cube<Bool> & flag);
00064 
00065 protected:
00066 
00067     void propagateChanAvgFlags (const Cube<Bool> &avgFlagCube, Cube<Bool> &expandedFlagCube);
00068     Bool parseConfiguration(const Record &configuration);
00069     void initialize();
00070 
00071         Vector<Int> chanbin_p;
00072         mutable map<Int,uInt > spwChanbinMap_p; // Must be accessed from const methods
00073 };
00074 
00076 // ChannelAverageTVIFactory class
00078 
00079 class ChannelAverageTVIFactory : public ViFactory
00080 {
00081 
00082 public:
00083 
00084         ChannelAverageTVIFactory(Record &configuration,ViImplementation2 *inputVII);
00085 
00086 protected:
00087 
00088         vi::ViImplementation2 * createVi (VisibilityIterator2 *) const;
00089         vi::ViImplementation2 * createVi () const;
00090 
00091         Record configuration_p;
00092         ViImplementation2 *inputVii_p;;
00093 };
00094 
00096 // ChannelAverageTVILayerFactory class  (for _recursive_ layering)
00098 
00099 class ChannelAverageTVILayerFactory : public ViiLayerFactory
00100 {
00101 
00102 public:
00103 
00104   ChannelAverageTVILayerFactory(Record &configuration);
00105 
00106   virtual ~ChannelAverageTVILayerFactory() {};
00107 
00108 protected:
00109 
00110   
00111   virtual ViImplementation2 * createInstance(ViImplementation2* vii0) const;
00112 
00113   const Record configuration_p;
00114 
00115 };
00116 
00118 // ChannelAverageTransformEngine class
00120 
00121 
00122 template<class T> class ChannelAverageKernel; // Forward declaration
00123 
00124 template<class T> class ChannelAverageTransformEngine : public FreqAxisTransformEngine2<T>
00125 {
00126 
00127         using FreqAxisTransformEngine2<T>::inputData_p;
00128         using FreqAxisTransformEngine2<T>::outputData_p;
00129 
00130 public:
00131 
00132         ChannelAverageTransformEngine   (       ChannelAverageKernel<T> *kernel,
00133                                                                                 DataCubeMap *inputData,
00134                                                                                 DataCubeMap *outputData,
00135                                                                                 uInt width);
00136 
00137         void transform();
00138 
00139 protected:
00140 
00141         uInt width_p;
00142         // This member has to be a pointer, otherwise there
00143         // are compile time problems due to the fact that
00144         // it is a pure virtual class.
00145         ChannelAverageKernel<T> *chanAvgKernel_p;
00146 };
00147 
00149 // ChannelAverageKernel class
00151 
00152 template<class T> class ChannelAverageKernel
00153 {
00154 
00155 public:
00156 
00157         virtual void kernel(DataCubeMap *inputData,
00158                                                 DataCubeMap *outputData,
00159                                                 uInt startInputPos,
00160                                                 uInt outputPos,
00161                                                 uInt width) = 0;
00162 };
00163 
00165 // PlainChannelAverageKernel class
00167 
00168 template<class T> class PlainChannelAverageKernel : public ChannelAverageKernel<T>
00169 {
00170 
00171 public:
00172 
00173         void kernel(    DataCubeMap *inputData,
00174                                         DataCubeMap *outputData,
00175                                         uInt startInputPos,
00176                                         uInt outputPos,
00177                                         uInt width);
00178 
00179 };
00180 
00182 // WeightedChannelAverageKernel class
00184 
00185 template<class T> class WeightedChannelAverageKernel : public ChannelAverageKernel<T>
00186 {
00187 
00188 public:
00189 
00190         void kernel(DataCubeMap *inputData,
00191                                 DataCubeMap *outputData,
00192                                 uInt startInputPos,
00193                                 uInt outputPos,
00194                                 uInt width);
00195 };
00196 
00198 // LogicalANDKernel class
00200 
00201 template<class T> class LogicalANDKernel : public ChannelAverageKernel<T>
00202 {
00203 
00204 public:
00205 
00206         void kernel(DataCubeMap *inputData,
00207                                 DataCubeMap *outputData,
00208                                 uInt startInputPos,
00209                                 uInt outputPos,
00210                                 uInt width);
00211 };
00212 
00214 // ChannelAccumulationKernel class
00216 
00217 template<class T> class ChannelAccumulationKernel : public ChannelAverageKernel<T>
00218 {
00219 
00220 public:
00221 
00222         void kernel(DataCubeMap *inputData,
00223                                 DataCubeMap *outputData,
00224                                 uInt startInputPos,
00225                                 uInt outputPos,
00226                                 uInt width);
00227 };
00228 
00229 } //# NAMESPACE VI - END
00230 
00231 } //# NAMESPACE CASA - END
00232 
00233 #endif /* ChannelAverageTVI_H_ */
00234 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1