casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageRegridder.h
Go to the documentation of this file.
1 //# Copyright (C) 1998,1999,2000,2001,2003
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This program is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU General Public License as published by the Free
6 //# Software Foundation; either version 2 of the License, or (at your option)
7 //# any later version.
8 //#
9 //# This program is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 //# more details.
13 //#
14 //# You should have received a copy of the GNU General Public License along
15 //# with this program; if not, write to the Free Software Foundation, Inc.,
16 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef IMAGEANALYSIS_IMAGEREGRIDDER_H
27 #define IMAGEANALYSIS_IMAGEREGRIDDER_H
28 
30 
31 #include <casa/namespace.h>
32 
33 namespace casacore{
34 
35 template <class T> class SubImage;
36 template <class T> class TempImage;
37 }
38 
39 namespace casa {
40 
41 
42 template<class T> class ImageRegridder : public ImageRegridderBase<T> {
43  // <summary>
44  // Top level interface which regrids an image to a specified coordinate
45  // system
46  // </summary>
47 
48  // <reviewed reviewer="" date="" tests="" demos="">
49  // </reviewed>
50 
51  // <prerequisite>
52  // </prerequisite>
53 
54  // <etymology>
55  // Regrids image.
56  // </etymology>
57 
58  // <synopsis>
59  // High level interface for regridding an image. Note that in the case of a
60  // complex-valued image, the image is first divided into its composite real
61  // and imaginary parts, and these parts are regridded independently. The
62  // resulting regridded images are combined to form the final regridded
63  // complex-valued image.
64  // </synopsis>
65 
66 public:
67 
68  ImageRegridder() = delete;
69 
70  // if <src>outname</src> is empty, no image will be written
71  // if <src>overwrite</src> is true, if image already exists it will be
72  // removed if <src>overwrite</src> is false, if image already exists
73  // exception will be thrown
74  // <group>
75 
77  const SPCIIT image, const casacore::Record *const regionRec,
78  const casacore::String& maskInp, const casacore::String& outname,
79  casacore::Bool overwrite, const casacore::CoordinateSystem& csysTo,
81  );
82 
83  // FIXME Add support to allow image and templateIm to be of different data
84  // types
86  const SPCIIT image, const casacore::String& outname,
87  const SPCIIT templateIm,
89  const casacore::Record *const regionRec=0,
90  const casacore::String& maskInp="", casacore::Bool overwrite=false,
92  );
93  // </group>
94 
95  // destructor
97 
98  // perform the regrid.
99  SPIIT regrid() const;
100 
101  inline casacore::String getClass() const { return _class; }
102 
104 
105 private:
106  mutable SPIIT _subimage;
108  static const casacore::String _class;
109 
110  SPIIT _regrid() const;
111 
112  SPIIT _regridByVelocity() const;
113 
114  casacore::Bool _doImagesOverlap(SPCIIT image0, SPCIIT image1) const;
115 
119  const casacore::IPosition& directionShape
120  );
121 
122  void _checkOutputShape(
123  const casacore::SubImage<T>& subImage,
124  const std::set<casacore::Coordinate::Type>& coordsToRegrid
125  ) const;
126 
127  SPIIT _decimateStokes(SPIIT workIm) const;
128 
130  const casacore::Vector<
131  std::pair<casacore::Double, casacore::Double>
132  >& corners0,
133  const casacore::Vector<
134  std::pair<casacore::Double, casacore::Double>
135  >& corners1
136  );
137 
138 };
139 }
140 
141 #ifndef CASACORE_NO_AUTO_TEMPLATES
142 #include <imageanalysis/ImageAnalysis/ImageRegridder.tcc>
143 #endif
144 
145 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
Temporary astronomical images.
void setDebug(casacore::Int debug)
casacore::Bool _doImagesOverlap(SPCIIT image0, SPCIIT image1) const
casacore::Int _debug
SPIIT _regrid() const
ImageRegridder()=delete
Top level interface which regrids an image to a specified coordinate system.
static casacore::Vector< std::pair< casacore::Double, casacore::Double > > _getDirectionCorners(const casacore::DirectionCoordinate &dc, const casacore::IPosition &directionShape)
static casacore::Bool _doRectanglesIntersect(const casacore::Vector< std::pair< casacore::Double, casacore::Double > > &corners0, const casacore::Vector< std::pair< casacore::Double, casacore::Double > > &corners1)
SPIIT _regridByVelocity() const
SPIIT _decimateStokes(SPIIT workIm) const
#define SPIIT
Definition: ImageTypedefs.h:34
Interconvert pixel positions and directions (e.g. RA/DEC).
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static const casacore::String _class
A (masked) subset of an ImageInterface object.
#define SPCIIT
Definition: ImageTypedefs.h:35
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
bool debug
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void _checkOutputShape(const casacore::SubImage< T > &subImage, const std::set< casacore::Coordinate::Type > &coordsToRegrid) const
casacore::String getClass() const
~ImageRegridder()
destructor
Interconvert pixel and world coordinates.
SPIIT regrid() const
perform the regrid.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42