casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ConvolveGridder.h
Go to the documentation of this file.
00001 //# ConvolveGridder.h: Definition for Convolutional Gridder
00002 //# Copyright (C) 1996,1997,1999,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be adressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id: ConvolveGridder.h 21024 2011-03-01 11:46:18Z gervandiepen $
00028 
00029 #ifndef SCIMATH_CONVOLVEGRIDDER_H
00030 #define SCIMATH_CONVOLVEGRIDDER_H
00031 
00032 #include <scimath/Mathematics/Gridder.h>
00033 #include <casa/BasicSL/String.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary>
00038 // Does convolutional gridding
00039 // </summary>
00040 
00041 template <class Domain, class Range>
00042 class ConvolveGridder : public Gridder<Domain, Range>
00043 {
00044 public:
00045 
00046   ConvolveGridder(const IPosition& shape, const Vector<Domain>& scale,
00047                   const Vector<Domain>& offset, const String& convType="SF");
00048 
00049   virtual void setConvolutionFunction(const String& type);
00050 
00051   virtual ~ConvolveGridder() {}
00052 
00053   virtual Bool grid(Array<Range>& gridded,
00054                     const Vector<Domain>& position,
00055                     const Range& value);
00056 
00057   virtual Bool degrid(const Array<Range>& gridded,
00058                       const Vector<Domain>& position,
00059                       Range& value);
00060 
00061   Vector<Double>& cFunction();
00062 
00063   Vector<Int>& cSupport();
00064 
00065   Int& cSampling();
00066 
00067 protected:
00068   virtual Range correctionFactor1D(Int loc, Int len);
00069 
00070 private:
00071   Vector<Double> convFunc;
00072   Vector<Int> supportVec;
00073   Vector<Int> loc;
00074   Int sampling;
00075   Int support;
00076   String cType;
00077 
00078 public:
00079   using Gridder<Domain,Range>::onGrid;
00080 protected:
00081   //# Make members of parent classes known.
00082   using Gridder<Domain,Range>::ndim;
00083   using Gridder<Domain,Range>::shape;
00084   using Gridder<Domain,Range>::scale;
00085   using Gridder<Domain,Range>::offset;
00086   using Gridder<Domain,Range>::posVec;
00087   using Gridder<Domain,Range>::locVec;
00088   using Gridder<Domain,Range>::shapeVec;
00089   using Gridder<Domain,Range>::zeroShapeVec;
00090   using Gridder<Domain,Range>::offsetVec;
00091   using Gridder<Domain,Range>::centerVec;
00092   using Gridder<Domain,Range>::fillCorrectionVectors;
00093 };
00094 
00095 } //# NAMESPACE CASA - END
00096 
00097 #ifndef CASACORE_NO_AUTO_TEMPLATES
00098 #include <scimath/Mathematics/ConvolveGridder.tcc>
00099 #endif //# CASACORE_NO_AUTO_TEMPLATES
00100 #endif