casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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:
80  LELImageCoord();
81 
82  LELImageCoord (const CoordinateSystem& coords, const ImageInfo& imageInfo,
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
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:118
int Int
Definition: aipstype.h:50
virtual Int doCompare(const LELImageCoord &other) const
Check how the coordinates of this and that image compare.
const Unit & unit() const
Get the brightness unit.
virtual LatticeExprNode makeExtendLattice(const LatticeExprNode &expr, const IPosition &newShape, const LELLattCoordBase &newCoord) const
Create an extension for an expression node.
virtual LatticeExprNode makeSubLattice(const LatticeExprNode &expr, const LattRegionHolder &region) const
Create a SubLattice for an expression node.
const CoordinateSystem & coordinates() const
Get the coordinates.
virtual LatticeExprNode makeRebinLattice(const LatticeExprNode &expr, const IPosition &binning) const
Create a rebinning for an expression node.
virtual String classname() const
The name of the class.
virtual Int compare(const LELLattCoordBase &other) const
Check how the coordinates of this and that compare.
const TableRecord & miscInfo() const
Get the MiscInfo.
defines physical units
Definition: Unit.h:189
Referenced counted pointer for constant data.
Definition: CountedPtr.h:80
CountedPtr< CoordinateSystem > coords_p
virtual Bool hasCoordinates() const
The class has true coordinates (thus returns True).
The letter class for image coordinates.
Definition: LELImageCoord.h:77
Class to hold a region of interest in an image.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1987
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:185
const ImageInfo & imageInfo() const
Get the ImageInfo.
The base letter class for lattice coordinates in LEL.
Bridging class to allow C++ expressions involving lattices.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
virtual uInt getSpectralInfo(Vector< Double > &worldCoordinates, const IPosition &shape) const
Get the coordinates of the spectral axis for the given shape.
Abstract base class for Record classes.
Miscellaneous information related to an image.
Definition: ImageInfo.h:92
Interconvert pixel and world coordinates.
The base letter class for lattice coordinates in LEL.
Definition: LELLattCoord.h:80
unsigned int uInt
Definition: aipstype.h:51