Loading...
Searching...
No Matches
MSSummary.h
Go to the documentation of this file.
//# MSSummary.h: Helper class for applications listing an image header
//# Copyright (C) 1996,1997,1998,1999,2000,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
#ifndef MS_MSSUMMARY_H
#define MS_MSSUMMARY_H
#include <casacore/casa/aips.h>
#include <casacore/casa/BasicSL/String.h>
#include <casacore/ms/MeasurementSets/MSColumns.h>
#include <memory>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MeasurementSet;
class LogIO;
class MSMetaData;
// <summary>Provides and lists information about the header of an image</summary>
// <use visibility=export>
//
// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
// </reviewed>
//
// <prerequisite>
// <li> <linkto class=MeasurementSet>MeasurementSet</linkto>
// <li> <linkto module=Coordinates>Coordinates</linkto>
// </prerequisite>
//
// <etymology>
// This class lists the ancilliary or header information from a
// MeasurementSet in a Summary format.
// </etymology>
//
// <synopsis>
// MSs consist of pixels and descriptive information stored in what
// is loosely termed the header. This is information describing the
// coordinate system, the image units etc. This class enables you to
// retrieve the descriptive header information and/or list it.
// </synopsis>
//
// <example>
// <srcBlock>
// PagedMS<Float> inMS(fileName);
// MSSummary<Float> header(inMS);
// LogOrigin or("myClass", "myFunction(...)", WHERE);
// LogIO os(or);
// header.list(os);
// </srcBlock>
// A <src>PagedMS</src> object is constructed and then logged to the
// supplied <src>LogIO</src> object.
// </example>
//
// <note role=caution>
// Note that if the <src>PagedMS</src> goes out of scope, this
// class will retrieve rubbish as it just maintains a pointer
// to the image.
// </note>
//
// <motivation>
// The viewing of the image header is a basic capability that is
// commonly required.
// </motivation>
//
// <todo asof="1998/12/09">
// There are various placeholders which will need to be activated for
// Version 2 of the MeasurementSet definition.
// </todo>
class MSSummary
{
public:
// Constructor
// <group>
// <src>maxCacheMB</src> is the maximum cache size in MB to use for the created
// MSMetaData object.
MSSummary (const MeasurementSet& ms, Float maxCacheMB = 50.0);
MSSummary (const MeasurementSet* ms, Float maxCacheMB = 50.0);
MSSummary (const MeasurementSet* ms, const String msname, Float maxCacheMB = 50.0);
// construct the object using an MSMetaDataObject
MSSummary (std::shared_ptr<MSMetaData> msmd);
// Destructor
~MSSummary();
// Retrieve number of rows
Int64 nrow() const;
// Retrieve image name
String name() const;
// Set a new MS. <src>maxCacheMB</src> is the maximum cache size of the
// created MSMetaData tool. If negative, the cache size used when this object
// was created is used.
Bool setMS (const MeasurementSet& ms, Float maxCacheMB=-1);
// List all header information.
void list (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
//Return some useful info in a record too along with os
void list (LogIO& os, Record& outRec, Bool verbose=False,
Bool fillRecord=True, Bool oneBased=True) const;
// List a title for the Summary.
void listTitle (LogIO& os) const;
// List convenient groupings of tables: list where MS obtained
// (Observation and Array tables)
void listWhere (LogIO& os, Bool verbose=False) const;
// List what was observed (Field and Main tables)
void listWhat (LogIO& os, Bool verbose=False) const;
void listWhat (LogIO& os, Record& outRec, Bool verbose=False,
Bool fillRecord=True) const;
// List how data were obtained (SpectralWindow, Feed, and Antenna tables)
void listHow (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
// List main table
void listMain (LogIO& os, Bool verbose=False) const;
//Return some useful info in a record too along with os
void listMain (LogIO& os, Record& outRec, Bool verbose=False,
Bool fillRecord=True) const;
// Return a Record with information derived from the main table
void getScanSummary (Record& outRec) const;
// List subtables
// <group>
void listAntenna (LogIO& os, Bool verbose=False) const;
void listFeed (LogIO& os, Bool verbose=False, Bool oneBased=True) const;
void listField (LogIO& os, Bool verbose=False) const;
void listField (LogIO& os, Record& outRec, Bool verbose=False,
Bool fillRecord=True) const;
void listObservation (LogIO& os, Bool verbose=False) const;
void listHistory (LogIO& os) const;
void listPolarization (LogIO& os, Bool verbose=False) const;
void listSource (LogIO& os, Bool verbose=False) const;
void listSpectralWindow (LogIO& os, Bool verbose=False) const;
void getSpectralWindowInfo(Record& outRec) const;
void listSpectralAndPolInfo (LogIO& os, Bool verbose=False,
Bool oneBased=True) const;
void listSysCal (LogIO& os, Bool verbose=False) const;
void listWeather (LogIO& os, Bool verbose=False) const;
// </group>
// List table size summary
void listTables (LogIO& os, Bool verbose=False) const;
void setListUnflaggedRowCount(Bool v) { _listUnflaggedRowCount = v; }
// OBSOLETE. No longer does anything, kept for compilation backward compatibility.
void setMetaDataCacheSizeInMB(Float) {}
private:
// Pointer to MS
const MeasurementSet* pMS;
std::shared_ptr<MSMetaData> _msmd;
// Formatting strings
const String dashlin1, dashlin2;
// Clear formatting flags
void clearFlags (LogIO& os) const;
// For keeping track of the number of vis per field
mutable Vector<Int> nVisPerField_;
// Name of the MS used in the constructor
String msname_p;
Bool _listUnflaggedRowCount;
Float _cacheSizeMB;
};
} //# NAMESPACE CASACORE - END
#endif
casacore::LogIO
Definition LogIO.h:165
casacore::MSMetaData
Definition MSMetaData.h:59
casacore::MSSummary::_msmd
std::shared_ptr< MSMetaData > _msmd
Definition MSSummary.h:178
casacore::MSSummary::listSysCal
void listSysCal(LogIO &os, Bool verbose=False) const
casacore::MSSummary::pMS
const MeasurementSet * pMS
Pointer to MS.
Definition MSSummary.h:177
casacore::MSSummary::listField
void listField(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
casacore::MSSummary::listTitle
void listTitle(LogIO &os) const
List a title for the Summary.
casacore::MSSummary::listMain
void listMain(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
Return some useful info in a record too along with os.
casacore::MSSummary::listTables
void listTables(LogIO &os, Bool verbose=False) const
List table size summary.
casacore::MSSummary::MSSummary
MSSummary(const MeasurementSet *ms, const String msname, Float maxCacheMB=50.0)
casacore::MSSummary::MSSummary
MSSummary(const MeasurementSet *ms, Float maxCacheMB=50.0)
casacore::MSSummary::listMain
void listMain(LogIO &os, Bool verbose=False) const
List main table.
casacore::MSSummary::listWhat
void listWhat(LogIO &os, Record &outRec, Bool verbose=False, Bool fillRecord=True) const
casacore::MSSummary::listWeather
void listWeather(LogIO &os, Bool verbose=False) const
casacore::MSSummary::setMetaDataCacheSizeInMB
void setMetaDataCacheSizeInMB(Float)
OBSOLETE.
Definition MSSummary.h:173
casacore::MSSummary::listObservation
void listObservation(LogIO &os, Bool verbose=False) const
casacore::MSSummary::listPolarization
void listPolarization(LogIO &os, Bool verbose=False) const
casacore::MSSummary::list
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.
casacore::MSSummary::nVisPerField_
Vector< Int > nVisPerField_
For keeping track of the number of vis per field.
Definition MSSummary.h:187
casacore::MSSummary::nrow
Int64 nrow() const
Retrieve number of rows.
casacore::MSSummary::listHistory
void listHistory(LogIO &os) const
casacore::MSSummary::getScanSummary
void getScanSummary(Record &outRec) const
Return a Record with information derived from the main table.
casacore::MSSummary::setListUnflaggedRowCount
void setListUnflaggedRowCount(Bool v)
Definition MSSummary.h:170
casacore::MSSummary::dashlin1
const String dashlin1
Formatting strings.
Definition MSSummary.h:181
casacore::MSSummary::listSpectralWindow
void listSpectralWindow(LogIO &os, Bool verbose=False) const
casacore::MSSummary::~MSSummary
~MSSummary()
Destructor.
casacore::MSSummary::_listUnflaggedRowCount
Bool _listUnflaggedRowCount
Definition MSSummary.h:192
casacore::MSSummary::name
String name() const
Retrieve image name.
casacore::MSSummary::list
void list(LogIO &os, Bool verbose=False, Bool oneBased=True) const
List all header information.
casacore::MSSummary::_cacheSizeMB
Float _cacheSizeMB
Definition MSSummary.h:194
casacore::MSSummary::clearFlags
void clearFlags(LogIO &os) const
Clear formatting flags.
casacore::MSSummary::listWhere
void listWhere(LogIO &os, Bool verbose=False) const
List convenient groupings of tables: list where MS obtained (Observation and Array tables).
casacore::MSSummary::setMS
Bool setMS(const MeasurementSet &ms, Float maxCacheMB=-1)
Set a new MS.
casacore::MSSummary::getSpectralWindowInfo
void getSpectralWindowInfo(Record &outRec) const
casacore::MSSummary::listWhat
void listWhat(LogIO &os, Bool verbose=False) const
List what was observed (Field and Main tables).
casacore::MSSummary::listField
void listField(LogIO &os, Bool verbose=False) const
casacore::MSSummary::listSource
void listSource(LogIO &os, Bool verbose=False) const
casacore::MSSummary::msname_p
String msname_p
Name of the MS used in the constructor.
Definition MSSummary.h:190
casacore::MSSummary::dashlin2
const String dashlin2
Definition MSSummary.h:181
casacore::MSSummary::listAntenna
void listAntenna(LogIO &os, Bool verbose=False) const
List subtables.
casacore::MSSummary::listSpectralAndPolInfo
void listSpectralAndPolInfo(LogIO &os, Bool verbose=False, Bool oneBased=True) const
casacore::MSSummary::MSSummary
MSSummary(std::shared_ptr< MSMetaData > msmd)
construct the object using an MSMetaDataObject
casacore::MSSummary::listHow
void listHow(LogIO &os, Bool verbose=False, Bool oneBased=True) const
List how data were obtained (SpectralWindow, Feed, and Antenna tables).
casacore::MSSummary::listFeed
void listFeed(LogIO &os, Bool verbose=False, Bool oneBased=True) const
casacore::MSSummary::MSSummary
MSSummary(const MeasurementSet &ms, Float maxCacheMB=50.0)
Constructor.
casacore::MeasurementSet
Definition MeasurementSet.h:278
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::Vector
Definition Vector.h:82
casacore::Record
Record()
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::False
const Bool False
Definition aipstype.h:42
casacore::Int64
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
casacore::Float
float Float
Definition aipstype.h:52
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::True
const Bool True
Definition aipstype.h:41