casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CLIPNearest2D.h
Go to the documentation of this file.
1 //# CLIPNearest2D.h: Nearest neighbour interpolator for CurvedLattice2D
2 //# Copyright (C) 2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have receied a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef LATTICES_CLIPNEAREST2D_H
29 #define LATTICES_CLIPNEAREST2D_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 //# Forward Declarations
40 template<class T> class Lattice;
41 
42 
43 // <summary>
44 // Arbitrarily shaped 1-dim lattice crosscut
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="" date="" tests="tPixelCurve.cc">
50 // </reviewed>
51 
52 // <prerequisite>
53 //# Classes you should understand before using this one.
54 // <li> <linkto class=CLInterpolator2D>CLInterpolator2D</linkto>
55 // </prerequisite>
56 
57 // <etymology>
58 // CLIP means CLInterpolator (its base class).
59 // The 2D means that interpolation in 2 dimensions needs to be done.
60 // </etymology>
61 
62 // <synopsis>
63 // CLIPNearest2D is a realisation of the abstract base class CLInterpolator2D.
64 // This class interpolates in a very simple way by taking the nearest
65 // neighbour.
66 //
67 // Note that the base class contains the lattice to be interpolated and
68 // the axis to be used in the interpolation.
69 // </synopsis>
70 
71 
72 template<class T>
74 {
75 public:
76  // Only default constructor is needed.
77  // The set function in the base class defines the lattice and axes.
78  CLIPNearest2D();
79 
80  // Make a copy of the object.
81  virtual CLIPNearest2D<T>* clone() const;
82 
83  // Get the data for the given pixel points (on axis1 and axis2) and
84  // the chunk in the other axes as given by the section.
85  virtual void getData (Array<T>& buffer,
86  const Vector<Float>& x,
87  const Vector<Float>& y,
88  const Slicer& section);
89 
90  // Get the mask for the given pixel points (on axis1 and axis2) and
91  // the chunk in the other axes as given by the section.
92  virtual void getMask (Array<Bool>& buffer,
93  const Vector<Float>& x,
94  const Vector<Float>& y,
95  const Slicer& section);
96 
97  //# Make members of parent class known.
98 protected:
105 };
106 
107 
108 
109 } //# NAMESPACE CASACORE - END
110 
111 #ifndef CASACORE_NO_AUTO_TEMPLATES
112 #include <casacore/lattices/LatticeMath/CLIPNearest2D.tcc>
113 #endif //# CASACORE_NO_AUTO_TEMPLATES
114 #endif
Abstract base class for interpolator used by CurvedLattice2D.
Definition: CurvedImage2D.h:40
virtual CLIPNearest2D< T > * clone() const
Make a copy of the object.
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:288
virtual void getData(Array< T > &buffer, const Vector< Float > &x, const Vector< Float > &y, const Slicer &section)
Get the data for the given pixel points (on axis1 and axis2) and the chunk in the other axes as given...
virtual void getMask(Array< Bool > &buffer, const Vector< Float > &x, const Vector< Float > &y, const Slicer &section)
Get the mask for the given pixel points (on axis1 and axis2) and the chunk in the other axes as given...
Arbitrarily shaped 1-dim lattice crosscut.
Definition: CLIPNearest2D.h:73
CLIPNearest2D()
Only default constructor is needed.