casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageMetaData.h
Go to the documentation of this file.
1 //# ImageMetaData.h: Meta information for Images
2 //# Copyright (C) 2009
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 IMAGEANALYSIS_IMAGEMETADATA_H
29 #define IMAGEANALYSIS_IMAGEMETADATA_H
30 
32 
34 #include <casa/aips.h>
35 
36 #include <memory>
37 
38 namespace casa {
39 
40 // <summary>
41 // A class in which to store and allow read-only access to image metadata.
42 // </summary>
43 
44 // <use visibility=export>
45 
46 // <reviewed reviewer="" date="" tests="" demos="">
47 // </reviewed>
48 
49 // <prerequisite>
50 // <li> <linkto class=casacore::ImageInterface>ImageInterface</linkto>
51 // </prerequisite>
52 
53 // <etymology>
54 // The ImageMetaData class name is derived from its role as holding image metadata.
55 // </etymology>
56 
57 // <synopsis>
58 // The ImageMetaData object is meant to allow access to image metadata (eg, shape,
59 // coordinate system info such as spectral and polarization axes numbers, etc).
60 // </synopsis>
61 
62 // <example>
63 // Construct an object of this class by passing the associated image to the constructor.
64 // <srcblock>
65 // casacore::PagedImage<casacore::Float> myImage("myImage");
66 // ImageMetaData<casacore::Float> myImageMetaData(myImage);
67 // </srcblock>
68 // </example>
69 
70 // <motivation>
71 // This class is meant to provide an object-oriented interface for accessing
72 // image metadata without polluting the casacore::ImageInterface and CoordinateSystem
73 // classes with these methods.
74 // </motivation>
75 // <todo>
76 // Merge casacore::ImageInfo class into this class.
77 // </todo>
78 
79 template <class T> class ImageMetaData : public ImageMetaDataBase<T> {
80 
81 public:
82 
83  ImageMetaData() = delete;
84 
85  ImageMetaData(SPCIIT image);
86 
88 
90 
91  // For ia.summary() moved from ImageAnalysis
93  const casacore::String& doppler, const casacore::Bool list,
94  const casacore::Bool pixelorder, const casacore::Bool verbose
95  );
96 
97 protected:
98 
99  const casacore::ImageInfo& _getInfo() const { return _info; }
100 
101  const casacore::CoordinateSystem& _getCoords() const { return _csys; }
102 
104 
106 
108 
110 
112 
113  std::vector<casacore::Quantity> _getIncrements() const;
114 
116 
118 
120 
122 
124 
126 
128 
130 
132 
134 
136 
138 
140 
141 private:
143 
146 
147  // These are mutable because they are only to be set once and
148  // then cached. If this contract is broken, and they are set elsewhere
149  // defects will likely occur.
159  mutable std::vector<casacore::Quantity> _refVal, _increment;
161 };
162 
163 }
164 
165 #ifndef AIPS_NO_TEMPLATE_SRC
166 #include <imageanalysis/ImageAnalysis/ImageMetaData.tcc>
167 #endif //# AIPS_NO_TEMPLATE_SRC
168 
169 #endif
casacore::MEpoch _obsdate
casacore::Vector< casacore::Double > _getRefPixel() const
casacore::Record _header
These are mutable because they are only to be set once and then cached.
casacore::Quantity _restFreq
casacore::String _getObject() const
casacore::String _observer
casacore::String _equinox
casacore::String _getProjection() const
casacore::String _getImType() const
casacore::String _projection
casacore::Vector< casacore::String > _axisUnits
std::vector< casacore::Quantity > _increment
casacore::GaussianBeam _beam
casacore::Record _stats
A Measure: instant in time.
Definition: MEpoch.h:104
casacore::Vector< casacore::String > _getMasks() const
Represents a Gaussian restoring beam associated with an image.
Definition: GaussianBeam.h:68
casacore::String _reffreqtype
const casacore::CoordinateSystem & _getCoords() const
casacore::Record toRecord(casacore::Bool verbose) const
convert the header info to a casacore::Record and list to logger if verbose=true
casacore::String _getTelescope() const
casacore::String _telescope
casacore::String _object
casacore::String _getEquinox() const
casacore::Vector< casacore::String > _getStokes() const
casacore::Vector< casacore::Quantity > _getRefValue() const
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
std::vector< casacore::Quantity > _getIncrements() const
casacore::Quantity _getRestFrequency() const
const casacore::CoordinateSystem _csys
casacore::GaussianBeam _getBeam() const
#define SPCIIT
Definition: ImageTypedefs.h:35
casacore::Vector< casacore::Double > _refPixel
casacore::Vector< casacore::String > _getAxisNames() const
casacore::Vector< casacore::String > _stokes
const casacore::ImageInfo & _getInfo() const
Definition: ImageMetaData.h:99
casacore::String _getRefFreqType() const
casacore::Vector< casacore::String > _axisNames
std::vector< casacore::Quantity > _refVal
String: the storage and methods of handling collections of characters.
Definition: String.h:223
const casacore::ImageInfo _info
casacore::String _getBrightnessUnit() const
A class in which to store and allow read-only access to image metadata.
Definition: ImageMetaData.h:79
casacore::String _getObserver() const
casacore::Vector< casacore::String > _masks
Miscellaneous information related to an image.
Definition: ImageInfo.h:92
casacore::Record summary(const casacore::String &doppler, const casacore::Bool list, const casacore::Bool pixelorder, const casacore::Bool verbose)
For ia.summary() moved from ImageAnalysis.
casacore::MEpoch _getObsDate() const
Interconvert pixel and world coordinates.
casacore::String _bunit
casacore::String _imtype
casacore::Vector< casacore::String > _getAxisUnits() const
casacore::Record _getStatistics() const