casacore
Loading...
Searching...
No Matches
MSSummary.h
Go to the documentation of this file.
1// # MSSummary.h: Helper class for applications listing an image header
2// # Copyright (C) 1996,1997,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 MS_MSSUMMARY_H
27#define MS_MSSUMMARY_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/BasicSL/String.h>
31#include <casacore/ms/MeasurementSets/MSColumns.h>
32#include <memory>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36class MeasurementSet;
37class LogIO;
38class MSMetaData;
39
40// <summary>Provides and lists information about the header of an image</summary>
41// <use visibility=export>
42//
43// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
44// </reviewed>
45//
46// <prerequisite>
47// <li> <linkto class=MeasurementSet>MeasurementSet</linkto>
48// <li> <linkto module=Coordinates>Coordinates</linkto>
49// </prerequisite>
50//
51// <etymology>
52// This class lists the ancilliary or header information from a
53// MeasurementSet in a Summary format.
54// </etymology>
55//
56// <synopsis>
57// MSs consist of pixels and descriptive information stored in what
58// is loosely termed the header. This is information describing the
59// coordinate system, the image units etc. This class enables you to
60// retrieve the descriptive header information and/or list it.
61// </synopsis>
62//
63// <example>
64// <srcBlock>
65// PagedMS<Float> inMS(fileName);
66// MSSummary<Float> header(inMS);
67// LogOrigin or("myClass", "myFunction(...)", WHERE);
68// LogIO os(or);
69// header.list(os);
70// </srcBlock>
71// A <src>PagedMS</src> object is constructed and then logged to the
72// supplied <src>LogIO</src> object.
73// </example>
74//
75// <note role=caution>
76// Note that if the <src>PagedMS</src> goes out of scope, this
77// class will retrieve rubbish as it just maintains a pointer
78// to the image.
79// </note>
80//
81// <motivation>
82// The viewing of the image header is a basic capability that is
83// commonly required.
84// </motivation>
85//
86// <todo asof="1998/12/09">
87// There are various placeholders which will need to be activated for
88// Version 2 of the MeasurementSet definition.
89// </todo>
90
91class MSSummary {
92 public:
93 // Constructor
94 // <group>
95 // <src>maxCacheMB</src> is the maximum cache size in MB to use for the created
96 // MSMetaData object.
97 MSSummary(const MeasurementSet& ms, Float maxCacheMB = 50.0);
98 MSSummary(const MeasurementSet* ms, Float maxCacheMB = 50.0);
99 MSSummary(const MeasurementSet* ms, const String msname, Float maxCacheMB = 50.0);
100
101 // construct the object using an MSMetaDataObject
102 MSSummary(std::shared_ptr<MSMetaData> msmd);
103
104 // Destructor
106
107 // Retrieve number of rows
108 Int64 nrow() const;
109
110 // Retrieve image name
111 String name() const;
112
113 // Set a new MS. <src>maxCacheMB</src> is the maximum cache size of the
114 // created MSMetaData tool. If negative, the cache size used when this object
115 // was created is used.
116 Bool setMS(const MeasurementSet& ms, Float maxCacheMB = -1);
117
118 // List all header information.
119 void list(LogIO& os, Bool verbose = False, Bool oneBased = True) const;
120 // Return some useful info in a record too along with os
121 void list(LogIO& os, Record& outRec, Bool verbose = False, Bool fillRecord = True,
122 Bool oneBased = True) const;
123
124 // List a title for the Summary.
125 void listTitle(LogIO& os) const;
126
127 // List convenient groupings of tables: list where MS obtained
128 // (Observation and Array tables)
129 void listWhere(LogIO& os, Bool verbose = False) const;
130
131 // List what was observed (Field and Main tables)
132 void listWhat(LogIO& os, Bool verbose = False) const;
133 void listWhat(LogIO& os, Record& outRec, Bool verbose = False, Bool fillRecord = True) const;
134 // List how data were obtained (SpectralWindow, Feed, and Antenna tables)
135 void listHow(LogIO& os, Bool verbose = False, Bool oneBased = True) const;
136
137 // List main table
138 void listMain(LogIO& os, Bool verbose = False) const;
139 // Return some useful info in a record too along with os
140 void listMain(LogIO& os, Record& outRec, Bool verbose = False, Bool fillRecord = True) const;
141 // Return a Record with information derived from the main table
142 void getScanSummary(Record& outRec) const;
143
144 // List subtables
145 // <group>
146 void listAntenna(LogIO& os, Bool verbose = False) const;
147 void listFeed(LogIO& os, Bool verbose = False, Bool oneBased = True) const;
148 void listField(LogIO& os, Bool verbose = False) const;
149 void listField(LogIO& os, Record& outRec, Bool verbose = False, Bool fillRecord = True) const;
150 void listObservation(LogIO& os, Bool verbose = False) const;
151 void listHistory(LogIO& os) const;
152 void listPolarization(LogIO& os, Bool verbose = False) const;
153 void listSource(LogIO& os, Bool verbose = False) const;
154 void listSpectralWindow(LogIO& os, Bool verbose = False) const;
155 void getSpectralWindowInfo(Record& outRec) const;
156 void listSpectralAndPolInfo(LogIO& os, Bool verbose = False, Bool oneBased = True) const;
157 void listSysCal(LogIO& os, Bool verbose = False) const;
158 void listWeather(LogIO& os, Bool verbose = False) const;
159 // </group>
160
161 // List table size summary
162 void listTables(LogIO& os, Bool verbose = False) const;
163
165
166 // OBSOLETE. No longer does anything, kept for compilation backward compatibility.
168
169 private:
170 // Pointer to MS
172 std::shared_ptr<MSMetaData> _msmd;
173
174 // Formatting strings
176
177 // Clear formatting flags
178 void clearFlags(LogIO& os) const;
179
180 // For keeping track of the number of vis per field
182
183 // Name of the MS used in the constructor
185
187
189};
190
191} // namespace casacore
192
193#endif
std::shared_ptr< MSMetaData > _msmd
Definition MSSummary.h:172
void listSysCal(LogIO &os, Bool verbose=False) const
const MeasurementSet * pMS
Pointer to MS.
Definition MSSummary.h:171
void listField(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
void listTitle(LogIO &os) const
List a title for the Summary.
void listMain(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
Return some useful info in a record too along with os.
void listTables(LogIO &os, Bool verbose=False) const
List table size summary.
MSSummary(const MeasurementSet *ms, const String msname, Float maxCacheMB=50.0)
MSSummary(const MeasurementSet *ms, Float maxCacheMB=50.0)
void listMain(LogIO &os, Bool verbose=False) const
List main table.
void listWhat(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
void listWeather(LogIO &os, Bool verbose=False) const
void setMetaDataCacheSizeInMB(Float)
OBSOLETE.
Definition MSSummary.h:167
void listObservation(LogIO &os, Bool verbose=False) const
void listPolarization(LogIO &os, Bool verbose=False) const
void list(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True, Bool oneBased=True) const
Return some useful info in a record too along with os.
Vector< Int > nVisPerField_
For keeping track of the number of vis per field.
Definition MSSummary.h:181
Int64 nrow() const
Retrieve number of rows.
void listHistory(LogIO &os) const
void getScanSummary(Record &outRec) const
Return a Record with information derived from the main table.
void setListUnflaggedRowCount(Bool v)
Definition MSSummary.h:164
const String dashlin1
Formatting strings.
Definition MSSummary.h:175
void listSpectralWindow(LogIO &os, Bool verbose=False) const
~MSSummary()
Destructor.
String name() const
Retrieve image name.
void list(LogIO &os, Bool verbose=False, Bool oneBased=True) const
List all header information.
void clearFlags(LogIO &os) const
Clear formatting flags.
void listWhere(LogIO &os, Bool verbose=False) const
List convenient groupings of tables: list where MS obtained (Observation and Array tables).
Bool setMS(const MeasurementSet &ms, Float maxCacheMB=-1)
Set a new MS.
void getSpectralWindowInfo(Record &outRec) const
void listWhat(LogIO &os, Bool verbose=False) const
List what was observed (Field and Main tables).
void listField(LogIO &os, Bool verbose=False) const
void listSource(LogIO &os, Bool verbose=False) const
String msname_p
Name of the MS used in the constructor.
Definition MSSummary.h:184
const String dashlin2
Definition MSSummary.h:175
void listAntenna(LogIO &os, Bool verbose=False) const
List subtables.
void listSpectralAndPolInfo(LogIO &os, Bool verbose=False, Bool oneBased=True) const
MSSummary(std::shared_ptr< MSMetaData > msmd)
construct the object using an MSMetaDataObject
void listHow(LogIO &os, Bool verbose=False, Bool oneBased=True) const
List how data were obtained (SpectralWindow, Feed, and Antenna tables).
void listFeed(LogIO &os, Bool verbose=False, Bool oneBased=True) const
MSSummary(const MeasurementSet &ms, Float maxCacheMB=50.0)
Constructor.
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
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
float Float
Definition aipstype.h:52
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41