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