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;
43
44// <summary>
45// The letter class for image coordinates.
46// </summary>
47
48// <use visibility=local>
49
50// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51// </reviewed>
52
53// <prerequisite>
54// <li> <linkto class=LELLattCoord>LELLattCoord</linkto>
55// </prerequisite>
56
57// <synopsis>
58// This class is a letter class for the envelope class
59// <linkto class=LELCoordinates>LELCoordinates</linkto>.
60// It acts as the coordinates class for Lattice objects with
61// proper coordinates (like PagedImage).
62// </synopsis>
63
64// <motivation>
65// It must be possible to handle image coordinates in a lattice.
66// expression.
67// </motivation>
68
69// # <todo asof="1996/07/01">
70// # <li>
71// # </todo>
72
74 public:
76
79
80 virtual ~LELImageCoord();
81
82 // Get the coordinates.
83 const CoordinateSystem& coordinates() const;
84
85 // Get the ImageInfo.
86 const ImageInfo& imageInfo() const;
87
88 // Get the brightness unit.
89 const Unit& unit() const;
90
91 // Get the MiscInfo.
92 const TableRecord& miscInfo() const;
93
94 // Create a SubLattice for an expression node.
96 const LattRegionHolder& region) const;
97
98 // Create an extension for an expression node.
99 virtual LatticeExprNode makeExtendLattice(const LatticeExprNode& expr, const IPosition& newShape,
100 const LELLattCoordBase& newCoord) const;
101
102 // Create a rebinning for an expression node.
104 const IPosition& binning) const;
105
106 // The class has true coordinates (thus returns True).
107 virtual Bool hasCoordinates() const;
108
109 // Get the coordinates of the spectral axis for the given shape.
110 // It returns the pixel axis number of the spectral coordinates.
111 // -1 indicates that there is no pixel spectral axis.
112 // An exception is thrown if there are no world spectral coordinates.
113 virtual uInt getSpectralInfo(Vector<Double>& worldCoordinates, const IPosition& shape) const;
114
115 // The name of the class.
116 virtual String classname() const;
117
118 // Check how the coordinates of this and that compare.
119 // The return value tells how they compare.
120 // <br>-1: this is subset
121 // <br>0: equal
122 // <br>1: this is superset
123 // <br>9: invalid (mismatch)
124 virtual Int compare(const LELLattCoordBase& other) const;
125
126 // Check how the coordinates of this and that image compare.
127 // This function is used by <src>conform</src> to make a
128 // double virtual dispatch possible.
129 virtual Int doCompare(const LELImageCoord& other) const;
130
131 private:
132 std::shared_ptr<CoordinateSystem> coords_p;
136};
137
138inline const CoordinateSystem& LELImageCoord::coordinates() const { return *coords_p; }
139
140inline const ImageInfo& LELImageCoord::imageInfo() const { return imageInfo_p; }
141
142inline const Unit& LELImageCoord::unit() const { return unit_p; }
143
144inline const TableRecord& LELImageCoord::miscInfo() const { return miscInfo_p; }
145
146} // namespace casacore
147
148#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:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
RecordInterface()
The default constructor creates an empty record with a variable structure.
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40