casacore
Loading...
Searching...
No Matches
ImageSummary.h
Go to the documentation of this file.
1// # ImageSummary.h: List descriptive information from an image
2// # Copyright (C) 1996,1997,1998,1999,2000,2001,2002
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_IMAGESUMMARY_H
27#define IMAGES_IMAGESUMMARY_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/measures/Measures/MFrequency.h>
32#include <casacore/measures/Measures/MDirection.h>
33#include <casacore/measures/Measures/MDoppler.h>
34#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
35#include <casacore/coordinates/Coordinates/ObsInfo.h>
36#include <casacore/images/Images/ImageInfo.h>
37#include <casacore/casa/Arrays/ArrayFwd.h>
38
39namespace casacore { // # NAMESPACE CASACORE - BEGIN
40
41// # Forward Declarations
42template <class T>
43class ImageInterface;
44class IPosition;
45class Unit;
46class LogIO;
47class Coordinate;
48
49// <summary>
50// Provides and lists information about the header of an image.
51// </summary>
52
53// <use visibility=export>
54
55// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
56// </reviewed>
57
58// <prerequisite>
59// <li> <linkto class=ImageInterface>ImageInterface</linkto>
60// <li> <linkto module=Coordinates>Coordinates</linkto>
61// </prerequisite>
62
63// <etymology>
64// This class lists the ancilliary descriptive information from an image
65// </etymology>
66
67// <synopsis>
68// Images consist of pixel values and descriptive information.
69// This information describes the coordinate system, the image
70// units etc. This class enables you to
71// retrieve the descriptive information and/or list it.
72// <p>
73// The functions that retrieve specific coordinate information in vectors
74// (e.g. <src>referenceValues</src>) return it in the order of the (pixel) axes of
75// the image. Note that this can be different from the order in which
76// the <linkto class=CoordinateSystem>CoordinateSystem</linkto>
77// functions of similar name might return them. This is because the
78// order of the coordinates in the CoordinateSystem is not necessarily
79// the same order as the pixel axes in the associated image, although
80// of course there is a known association.
81//
82// <note role=tip>
83// This class lists information about the coordinates in the image.
84// The Coordinates classes can maintain the information in a variety
85// of units. For example, angular quantities are by default in radians,
86// but the manipulator of a <linkto class=CoordinateSystem>CoordinateSystem</linkto>
87// may have converted to some other unit such as arcseconds. This
88// means that when this class fetches coordinate information and returns
89// it to you (such as the <src>referenceValues()</src> function,
90// the information is returned to you in whatever units the coordinates
91// are currently in. It does not convert it.
92// </note>
93// </synopsis>
94
95// <example>
96// <srcBlock>
97// PagedImage<Float> inImage(fileName);
98// ImageSummary<Float> summary(inImage);
99// LogOrigin or("myClass", "myFunction(...)", WHERE);
100// LogIO os(or);
101// summary.list(os);
102// </srcBlock>
103// A <src>PagedImage</src> object is constructed and then logged to the
104// supplied <src>LogIO</src> object.
105// </example>
106
107// <motivation>
108// The viewing of the descriptive image information is a basic capability.
109// </motivation>
110
111// # <todo asof="1998/08/31">
112// # None that I know of.
113// # </todo>
114
115template <class T>
117 public:
118 // Constructor
120
121 // Copy constructor
123
124 // Destructor
126
127 // Assignment operator
129
130 // Retrieve number of image dimension
131 Int ndim() const;
132
133 // Retrieve image shape
135
136 // Retrieve tile shape with which image is stored on disk
138
139 // Retrieve axis names in pixel or world axis order.
140 Vector<String> axisNames(Bool pixelOrder = True) const;
141
142 // Retrieve reference pixels (0 or 1 rel)
144
145 // Retrieve reference values in pixel or world axis order.
147
148 // Retrieve axis increments in pixel or world axis order.
150
151 // Retrieve axis units in pixel or world axis order.
152 Vector<String> axisUnits(Bool pixelOrder = True) const;
153
154 // Retrieve image units
155 Unit units() const;
156
157 // Retrieve image name. Any prepended path is stripped off.
158 String name() const;
159
160 // Retrieve observer name
162
163 // Return epoch of observation as MEpoch or formatted string
165
166 // Return telescope
168
169 // Return rest frequency. Returns False if none.
170 Bool restFrequency(String& restFreqString, Quantum<Double>& restFreq) const;
171
172 // Return frequency system. Returns False if none.
173 Bool frequencySystem(String& freqTypeString, MFrequency::Types& freqType) const;
174
175 // Return direction system. Returns False if none.
176 Bool directionSystem(String& dirTypeString, MDirection::Types& dirType) const;
177
178 // Retrieve whether image has mask or not
179 Bool hasAMask() const;
180
181 // Retrieve mask names
183
184 // Retrieve region names
186
187 // Retrieve default mask name. Empty if none
189
190 // Retrieve image type
192
193 // List all header information. By default, the reference
194 // values and pixel increments are converted to a "nice" unit before
195 // formatting (e.g. RA is shown as HH:MM:SS.S).
196 // For spectral axes, both frequency and velocity information is listed. You
197 // can specify what velocity definition you want with <src>velocityType</src>
198 // If postLocally is True, the formatted strings are returned in the return value
200 Bool postLocally = False, const Bool verbose = False);
201
202 // Set a new image
204
205 private:
210
213};
214
215} // namespace casacore
216
217#ifndef CASACORE_NO_AUTO_TEMPLATES
218#include <casacore/images/Images/ImageSummary.tcc>
219#endif // # CASACORE_NO_AUTO_TEMPLATES
220#endif
Vector< String > list(LogIO &os, const MDoppler::Types velocityType=MDoppler::RADIO, Bool postLocally=False, const Bool verbose=False)
List all header information.
String telescope() const
Return telescope.
ImageSummary< T > & operator=(const ImageSummary< T > &other)
Assignment operator.
Vector< String > axisUnits(Bool pixelOrder=True) const
Retrieve axis units in pixel or world axis order.
String imageType() const
Retrieve image type.
~ImageSummary()
Destructor.
String obsDate(MEpoch &date) const
Return epoch of observation as MEpoch or formatted string.
Vector< String > maskNames() const
Retrieve mask names.
Bool hasAMask() const
Retrieve whether image has mask or not.
IPosition shape() const
Retrieve image shape.
Int ndim() const
Retrieve number of image dimension.
String defaultMaskName() const
Retrieve default mask name.
ImageSummary(const ImageSummary< T > &other)
Copy constructor.
String observer() const
Retrieve observer name.
String makeMasksString() const
String name() const
Retrieve image name.
Bool directionSystem(String &dirTypeString, MDirection::Types &dirType) const
Return direction system.
Vector< Double > axisIncrements(Bool pixelOrder=True) const
Retrieve axis increments in pixel or world axis order.
Vector< Double > referenceValues(Bool pixelOrder=True) const
Retrieve reference values in pixel or world axis order.
String makeRegionsString() const
Vector< String > regionNames() const
Retrieve region names.
const ImageInterface< T > * pImage_p
IPosition tileShape() const
Retrieve tile shape with which image is stored on disk.
Bool setNewImage(const ImageInterface< T > &image)
Set a new image.
Bool restFrequency(String &restFreqString, Quantum< Double > &restFreq) const
Return rest frequency.
Bool frequencySystem(String &freqTypeString, MFrequency::Types &freqType) const
Return frequency system.
CoordinateSystem cSys_p
Vector< Double > referencePixels(Bool oneRel=True) const
Retrieve reference pixels (0 or 1 rel).
ImageSummary(const ImageInterface< T > &)
Constructor.
Unit units() const
Retrieve image units.
Vector< String > axisNames(Bool pixelOrder=True) const
Retrieve axis names in pixel or world axis order.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:187
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition MDoppler.h:149
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition MFrequency.h:175
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
const Bool False
Definition aipstype.h:42
TableExprNode date(const TableExprNode &node)
Definition ExprNode.h:1320
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41