casacore
LELImageCoord.h
Go to the documentation of this file.
1 //# LELImageCoord.h: The letter class for image coordinates
2 //# Copyright (C) 1998,1999,2000,2001
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 received 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 IMAGES_LELIMAGECOORD_H
29 #define IMAGES_LELIMAGECOORD_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/lattices/LEL/LELLattCoord.h>
34 #include <casacore/coordinates/Coordinates/CoordinateSystem.h>
35 #include <casacore/images/Images/ImageInfo.h>
36 #include <casacore/tables/Tables/TableRecord.h>
37 #include <casacore/casa/Quanta/Unit.h>
38 #include <casacore/casa/Utilities/CountedPtr.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# Forward Declarations
43 class LatticeExprNode;
44 class LattRegionHolder;
45 
46 
47 // <summary>
48 // The letter class for image coordinates.
49 // </summary>
50 
51 // <use visibility=local>
52 
53 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> <linkto class=LELLattCoord>LELLattCoord</linkto>
58 // </prerequisite>
59 
60 // <synopsis>
61 // This class is a letter class for the envelope class
62 // <linkto class=LELCoordinates>LELCoordinates</linkto>.
63 // It acts as the coordinates class for Lattice objects with
64 // proper coordinates (like PagedImage).
65 // </synopsis>
66 
67 // <motivation>
68 // It must be possible to handle image coordinates in a lattice.
69 // expression.
70 // </motivation>
71 
72 //# <todo asof="1996/07/01">
73 //# <li>
74 //# </todo>
75 
76 
78 {
79 public:
81 
83  const Unit& unit, const RecordInterface& miscInfo);
84 
85  virtual ~LELImageCoord();
86 
87  // Get the coordinates.
88  const CoordinateSystem& coordinates() const;
89 
90  // Get the ImageInfo.
91  const ImageInfo& imageInfo() const;
92 
93  // Get the brightness unit.
94  const Unit& unit() const;
95 
96  // Get the MiscInfo.
97  const TableRecord& miscInfo() const;
98 
99  // Create a SubLattice for an expression node.
101  (const LatticeExprNode& expr,
102  const LattRegionHolder& region) const;
103 
104  // Create an extension for an expression node.
106  (const LatticeExprNode& expr,
107  const IPosition& newShape,
108  const LELLattCoordBase& newCoord) const;
109 
110  // Create a rebinning for an expression node.
112  (const LatticeExprNode& expr,
113  const IPosition& binning) const;
114 
115  // The class has true coordinates (thus returns True).
116  virtual Bool hasCoordinates() const;
117 
118  // Get the coordinates of the spectral axis for the given shape.
119  // It returns the pixel axis number of the spectral coordinates.
120  // -1 indicates that there is no pixel spectral axis.
121  // An exception is thrown if there are no world spectral coordinates.
122  virtual uInt getSpectralInfo (Vector<Double>& worldCoordinates,
123  const IPosition& shape) const;
124 
125  // The name of the class.
126  virtual String classname() const;
127 
128  // Check how the coordinates of this and that compare.
129  // The return value tells how they compare.
130  // <br>-1: this is subset
131  // <br>0: equal
132  // <br>1: this is superset
133  // <br>9: invalid (mismatch)
134  virtual Int compare (const LELLattCoordBase& other) const;
135 
136  // Check how the coordinates of this and that image compare.
137  // This function is used by <src>conform</src> to make a
138  // double virtual dispatch possible.
139  virtual Int doCompare (const LELImageCoord& other) const;
140 
141 private:
146 };
147 
148 
150 {
151  return *coords_p;
152 }
153 
154 inline const ImageInfo& LELImageCoord::imageInfo() const
155 {
156  return imageInfo_p;
157 }
158 
159 inline const Unit& LELImageCoord::unit() const
160 {
161  return unit_p;
162 }
163 
165 {
166  return miscInfo_p;
167 }
168 
169 
170 
171 } //# NAMESPACE CASACORE - END
172 
173 #endif
Referenced counted pointer for constant data.
Definition: CountedPtr.h:81
virtual LatticeExprNode makeRebinLattice(const LatticeExprNode &expr, const IPosition &binning) const
Create a rebinning for an expression node.
virtual Int compare(const LELLattCoordBase &other) const
Check how the coordinates of this and that compare.
LELImageCoord(const CoordinateSystem &coords, const ImageInfo &imageInfo, const Unit &unit, const RecordInterface &miscInfo)
virtual Int doCompare(const LELImageCoord &other) const
Check how the coordinates of this and that image compare.
virtual LatticeExprNode makeExtendLattice(const LatticeExprNode &expr, const IPosition &newShape, const LELLattCoordBase &newCoord) const
Create an extension for an expression node.
virtual String classname() const
The name of the class.
const Unit & unit() const
Get the brightness unit.
virtual uInt getSpectralInfo(Vector< Double > &worldCoordinates, const IPosition &shape) const
Get the coordinates of the spectral axis for the given shape.
virtual LatticeExprNode makeSubLattice(const LatticeExprNode &expr, const LattRegionHolder &region) const
Create a SubLattice for an expression node.
virtual Bool hasCoordinates() const
The class has true coordinates (thus returns True).
const TableRecord & miscInfo() const
Get the MiscInfo.
const CoordinateSystem & coordinates() const
Get the coordinates.
CountedPtr< CoordinateSystem > coords_p
const ImageInfo & imageInfo() const
Get the ImageInfo.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
Definition: ExprNode.h:1987
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42