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
91
93{
94public:
95// Constructor
96// <group>
97// <src>maxCacheMB</src> is the maximum cache size in MB to use for the created
98// MSMetaData object.
99 MSSummary (const MeasurementSet& ms, Float maxCacheMB = 50.0);
100 MSSummary (const MeasurementSet* ms, Float maxCacheMB = 50.0);
101 MSSummary (const MeasurementSet* ms, const String msname, Float maxCacheMB = 50.0);
102
103 // construct the object using an MSMetaDataObject
104 MSSummary (std::shared_ptr<MSMetaData> msmd);
105
106// Destructor
108
109// Retrieve number of rows
110 Int64 nrow() const;
111
112// Retrieve image name
113 String name() const;
114
115// Set a new MS. <src>maxCacheMB</src> is the maximum cache size of the
116// created MSMetaData tool. If negative, the cache size used when this object
117// was created is used.
118 Bool setMS (const MeasurementSet& ms, Float maxCacheMB=-1);
119
120// List all header information.
121 void list (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
122//Return some useful info in a record too along with os
123 void list (LogIO& os, Record& outRec, Bool verbose=False,
124 Bool fillRecord=True, Bool oneBased=True) const;
125
126// List a title for the Summary.
127 void listTitle (LogIO& os) const;
128
129// List convenient groupings of tables: list where MS obtained
130// (Observation and Array tables)
131 void listWhere (LogIO& os, Bool verbose=False) const;
132
133// List what was observed (Field and Main tables)
134 void listWhat (LogIO& os, Bool verbose=False) const;
135 void listWhat (LogIO& os, Record& outRec, Bool verbose=False,
136 Bool fillRecord=True) const;
137// List how data were obtained (SpectralWindow, Feed, and Antenna tables)
138 void listHow (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
139
140// List main table
141 void listMain (LogIO& os, Bool verbose=False) const;
142//Return some useful info in a record too along with os
143 void listMain (LogIO& os, Record& outRec, Bool verbose=False,
144 Bool fillRecord=True) const;
145 // Return a Record with information derived from the main table
146 void getScanSummary (Record& outRec) const;
147
148// List subtables
149// <group>
150 void listAntenna (LogIO& os, Bool verbose=False) const;
151 void listFeed (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
152 void listField (LogIO& os, Bool verbose=False) const;
153 void listField (LogIO& os, Record& outRec, Bool verbose=False,
154 Bool fillRecord=True) const;
155 void listObservation (LogIO& os, Bool verbose=False) const;
156 void listHistory (LogIO& os) const;
157 void listPolarization (LogIO& os, Bool verbose=False) const;
158 void listSource (LogIO& os, Bool verbose=False) const;
159 void listSpectralWindow (LogIO& os, Bool verbose=False) const;
160 void getSpectralWindowInfo(Record& outRec) const;
162 Bool oneBased=True) const;
163 void listSysCal (LogIO& os, Bool verbose=False) const;
164 void listWeather (LogIO& os, Bool verbose=False) const;
165// </group>
166
167// List table size summary
168 void listTables (LogIO& os, Bool verbose=False) const;
169
171
172 // OBSOLETE. No longer does anything, kept for compilation backward compatibility.
174
175private:
176// Pointer to MS
178 std::shared_ptr<MSMetaData> _msmd;
179
180// Formatting strings
182
183// Clear formatting flags
184 void clearFlags (LogIO& os) const;
185
186// For keeping track of the number of vis per field
188
189 // Name of the MS used in the constructor
191
193
195};
196
197
198} //# NAMESPACE CASACORE - END
199
200#endif
std::shared_ptr< MSMetaData > _msmd
Definition MSSummary.h:178
void listSysCal(LogIO &os, Bool verbose=False) const
const MeasurementSet * pMS
Pointer to MS.
Definition MSSummary.h:177
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:173
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:187
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:170
const String dashlin1
Formatting strings.
Definition MSSummary.h:181
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:190
const String dashlin2
Definition MSSummary.h:181
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:223
this file contains all the compiler specific defines
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