//# ConvolutionTVI.h: This file contains the interface definition of the MSTransformManager class. //# //# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/) //# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved. //# Copyright (C) European Southern Observatory, 2011, All rights reserved. //# //# This library is free software; you can redistribute it and/or //# modify it under the terms of the GNU Lesser General Public //# License as published by the Free software Foundation; either //# version 2.1 of the License, or (at your option) any later version. //# //# This library is distributed in the hope that it will be useful, //# but WITHOUT ANY WARRANTY, without even the implied warranty of //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //# Lesser General Public License for more details. //# //# You should have received a copy of the GNU Lesser General Public //# License along with this library; if not, write to the Free Software //# Foundation, Inc., 59 Temple Place, Suite 330, Boston, //# MA 02111-1307 USA //# $Id: $ #ifndef ConvolutionTVI_H_ #define ConvolutionTVI_H_ // Base class #include namespace casa { //# NAMESPACE CASA - BEGIN namespace vi { //# NAMESPACE VI - BEGIN ////////////////////////////////////////////////////////////////////////// // ConvolutionTVI class ////////////////////////////////////////////////////////////////////////// class ConvolutionTVI : public FreqAxisTVI { public: ConvolutionTVI( ViImplementation2 * inputVii, const casacore::Record &configuration = casacore::Record()); void flag(casacore::Cube& flagCube) const; void floatData (casacore::Cube & vis) const; void visibilityObserved (casacore::Cube & vis) const; void visibilityCorrected (casacore::Cube & vis) const; void visibilityModel (casacore::Cube & vis) const; void weightSpectrum(casacore::Cube &weightSp) const; void sigmaSpectrum (casacore::Cube &sigmaSp) const; bool weightSpectrumExists () const {return true;} bool sigmaSpectrumExists () const {return true;} protected: casacore::Bool parseConfiguration(const casacore::Record &configuration); void initialize(); mutable casacore::Vector convCoeff_p; }; ////////////////////////////////////////////////////////////////////////// // ConvolutionTVIFactory class ////////////////////////////////////////////////////////////////////////// class ConvolutionTVIFactory : public ViFactory { public: ConvolutionTVIFactory(casacore::Record &configuration,ViImplementation2 *inputVII); protected: vi::ViImplementation2 * createVi (VisibilityIterator2 *) const; vi::ViImplementation2 * createVi () const; casacore::Record configuration_p; ViImplementation2 *inputVii_p;; }; ////////////////////////////////////////////////////////////////////////// // ConvolutionTransformEngine class ////////////////////////////////////////////////////////////////////////// template class ConvolutionKernel; // Forward declaration template class ConvolutionTransformEngine : public FreqAxisTransformEngine { public: ConvolutionTransformEngine(ConvolutionKernel *kernel, casacore::uInt width); void transform(casacore::Vector &inputVector,casacore::Vector &outputVector); protected: casacore::uInt width_p; // This member has to be a pointer, otherwise there // are compile time problems due to the fact that // it is a pure virtual class. ConvolutionKernel *convolutionKernel_p; }; ////////////////////////////////////////////////////////////////////////// // ConvolutionKernel class ////////////////////////////////////////////////////////////////////////// template class ConvolutionKernel { public: ConvolutionKernel(casacore::Vector *convCoeff); virtual void kernel( casacore::Vector &inputVector, casacore::Vector &outputVector, casacore::uInt startInputPos, casacore::uInt outputPos) = 0; protected: casacore::uInt width_p; casacore::Vector *convCoeff_p; }; ////////////////////////////////////////////////////////////////////////// // ConvolutionDataKernel class ////////////////////////////////////////////////////////////////////////// template class ConvolutionDataKernel : public ConvolutionKernel { using ConvolutionKernel::width_p; using ConvolutionKernel::convCoeff_p; public: ConvolutionDataKernel(casacore::Vector *convCoeff); void kernel( casacore::Vector &inputVector, casacore::Vector &outputVector, casacore::uInt startInputPos, casacore::uInt outputPos); }; ////////////////////////////////////////////////////////////////////////// // ConvolutionLogicalORKernel class ////////////////////////////////////////////////////////////////////////// template class ConvolutionLogicalORKernel : public ConvolutionKernel { using ConvolutionKernel::width_p; using ConvolutionKernel::convCoeff_p; public: ConvolutionLogicalORKernel(casacore::Vector *convCoeff); void kernel( casacore::Vector &inputVector, casacore::Vector &outputVector, casacore::uInt startInputPos, casacore::uInt outputPos); }; ////////////////////////////////////////////////////////////////////////// // ConvolutionWeightPropagationKernel class ////////////////////////////////////////////////////////////////////////// template class ConvolutionWeightPropagationKernel : public ConvolutionKernel { using ConvolutionKernel::width_p; using ConvolutionKernel::convCoeff_p; public: ConvolutionWeightPropagationKernel(casacore::Vector *convCoeff); void kernel( casacore::Vector &inputVector, casacore::Vector &outputVector, casacore::uInt startInputPos, casacore::uInt outputPos); }; } //# NAMESPACE VI - END } //# NAMESPACE CASA - END #endif /* ConvolutionTVI_H_ */