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