casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CLIPNearest2D.h
Go to the documentation of this file.
00001 //# CLIPNearest2D.h: Nearest neighbour interpolator for CurvedLattice2D
00002 //# Copyright (C) 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 receied 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 addressed 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 //# $Id: CLIPNearest2D.h 20229 2008-01-29 15:19:06Z gervandiepen $
00027 
00028 #ifndef LATTICES_CLIPNEAREST2D_H
00029 #define LATTICES_CLIPNEAREST2D_H
00030 
00031 
00032 //# Includes
00033 #include <lattices/Lattices/CLInterpolator2D.h>
00034 #include <casa/Arrays/AxesMapping.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 //# Forward Declarations
00039 template<class T> class Lattice;
00040 
00041 
00042 // <summary>
00043 // Arbitrarily shaped 1-dim lattice crosscut
00044 // </summary>
00045 
00046 // <use visibility=export>
00047 
00048 // <reviewed reviewer="" date="" tests="tPixelCurve.cc">
00049 // </reviewed>
00050 
00051 // <prerequisite>
00052 //# Classes you should understand before using this one.
00053 //   <li> <linkto class=CLInterpolator2D>CLInterpolator2D</linkto>
00054 // </prerequisite>
00055 
00056 // <etymology>
00057 // CLIP means CLInterpolator (its base class).
00058 // The 2D means that interpolation in 2 dimensions needs to be done.
00059 // </etymology>
00060 
00061 // <synopsis>
00062 // CLIPNearest2D is a realisation of the abstract base class CLInterpolator2D.
00063 // This class interpolates in a very simple way by taking the nearest
00064 // neighbour.
00065 //
00066 // Note that the base class contains the lattice to be interpolated and
00067 // the axis to be used in the interpolation.
00068 // </synopsis>
00069 
00070 
00071 template<class T>
00072 class CLIPNearest2D: public CLInterpolator2D<T>
00073 {
00074 public:
00075   // Only default constructor is needed.
00076   // The set function in the base class defines the lattice and axes.
00077   CLIPNearest2D();
00078 
00079   // Make a copy of the object.
00080   virtual CLIPNearest2D<T>* clone() const;
00081 
00082   // Get the data for the given pixel points (on axis1 and axis2) and
00083   // the chunk in the other axes as given by the section.
00084   virtual void getData (Array<T>& buffer,
00085                         const Vector<Float>& x,
00086                         const Vector<Float>& y,
00087                         const Slicer& section);
00088 
00089   // Get the mask for the given pixel points (on axis1 and axis2) and
00090   // the chunk in the other axes as given by the section.
00091   virtual void getMask (Array<Bool>& buffer,
00092                         const Vector<Float>& x,
00093                         const Vector<Float>& y,
00094                         const Slicer& section);
00095 
00096   //# Make members of parent class known.
00097 protected:
00098   using CLInterpolator2D<T>::itsAxesMap;
00099   using CLInterpolator2D<T>::itsAxis1;
00100   using CLInterpolator2D<T>::itsAxis2;
00101   using CLInterpolator2D<T>::itsCurveAxis;
00102   using CLInterpolator2D<T>::itsIsRef;
00103   using CLInterpolator2D<T>::itsLatticePtr;
00104 };
00105 
00106 
00107 
00108 } //# NAMESPACE CASA - END
00109 
00110 #ifndef CASACORE_NO_AUTO_TEMPLATES
00111 #include <lattices/Lattices/CLIPNearest2D.tcc>
00112 #endif //# CASACORE_NO_AUTO_TEMPLATES
00113 #endif