casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::DerivedMSCal Class Reference

Virtual column engine to return derived MS values. More...

#include <DerivedMSCal.h>

Inheritance diagram for casacore::DerivedMSCal:
casacore::VirtualColumnEngine casacore::DataManager

Public Member Functions

 DerivedMSCal ()
 Create the data manager. More...
 
 DerivedMSCal (const Record &spec)
 Create a Lofar storage manager with the given name. More...
 
 ~DerivedMSCal ()
 
virtual DataManagerclone () const
 Clone this object. More...
 
virtual void prepare ()
 Prepare the object. More...
 
virtual String dataManagerType () const
 Get the type name of the data manager (i.e. More...
 
virtual Record dataManagerSpec () const
 Record a record containing data manager specifications. More...
 
virtual Bool canAddColumn () const
 Columns can be added. More...
 
virtual Bool canRemoveColumn () const
 Columns can be removed. More...
 
- Public Member Functions inherited from casacore::VirtualColumnEngine
 VirtualColumnEngine ()
 Create the object. More...
 
virtual ~VirtualColumnEngine ()
 
- Public Member Functions inherited from casacore::DataManager
 DataManager ()
 Default constructor. More...
 
virtual ~DataManager ()
 
virtual String dataManagerName () const
 Return the name of the data manager. More...
 
void dataManagerInfo (Record &info) const
 Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info. More...
 
virtual Record getProperties () const
 Get data manager properties that can be modified. More...
 
virtual void setProperties (const Record &spec)
 Modify data manager properties given in record fields. More...
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects. More...
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager. More...
 
uInt sequenceNr () const
 Get the (unique) sequence nr of this data manager. More...
 
uInt ncolumn () const
 Get the nr of columns in this data manager (can be zero). More...
 
Bool asBigEndian () const
 Have the data to be stored in big or little endian canonical format? More...
 
const TSMOptiontsmOption () const
 Get the TSM option. More...
 
MultiFileBasemultiFile ()
 Get the MultiFile pointer (can be 0). More...
 
String keywordName (const String &keyword) const
 Compose a keyword name from the given keyword appended with the sequence number (e.g. More...
 
String fileName () const
 Compose a unique filename from the table name and sequence number. More...
 
ByteIO::OpenOption fileOption () const
 Get the AipsIO option of the underlying file. More...
 
virtual Bool isRegular () const
 Is this a regular storage manager? It is regular if it allows addition of rows and writing data in them. More...
 
Tabletable () const
 Get the table this object is associated with. More...
 
virtual void reopenRW ()
 Reopen the data manager for read/write access. More...
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes) More...
 
virtual void setMaximumCacheSize (uInt nMiB)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
virtual void showCacheStatistics (std::ostream &) const
 Show the data manager's IO statistics. More...
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column. More...
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column. More...
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column. More...
 
DataManagergetClone () const
 Has the object already been cloned? More...
 
void setClone (DataManager *clone) const
 Set the pointer to the clone. More...
 

Static Public Member Functions

static DataManagermakeObject (const String &dataManName, const Record &spec)
 Make the object from the type name string. More...
 
static void registerClass ()
 Register the class name and the static makeObject "constructor". More...
 
- Static Public Member Functions inherited from casacore::DataManager
static void registerCtor (const String &type, DataManagerCtor func)
 Register a mapping of a data manager type to its static construction function. More...
 
static DataManagerCtor getCtor (const String &dataManagerType)
 Get the "constructor" of a data manager (thread-safe). More...
 
static Bool isRegistered (const String &dataManagerType)
 Test if a data manager is registered (thread-safe). More...
 
static DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types. More...
 

Private Member Functions

 DerivedMSCal (const DerivedMSCal &that)
 Copy constructor cannot be used. More...
 
DerivedMSCaloperator= (const DerivedMSCal &that)
 Assignment cannot be used. More...
 
virtual void addColumn (DataManagerColumn *)
 Do the final addition of a column. More...
 
virtual void removeColumn (DataManagerColumn *)
 Remove a column from the data file. More...
 
virtual DataManagerColumnmakeScalarColumn (const String &aName, int aDataType, const String &aDataTypeID)
 Create a column in the storage manager on behalf of a table column. More...
 
virtual DataManagerColumnmakeIndArrColumn (const String &aName, int aDataType, const String &aDataTypeID)
 Create an indirect array column. More...
 

Private Attributes

MSCalEngine itsEngine
 
vector< DataManagerColumn * > itsColumns
 

Additional Inherited Members

- Static Public Attributes inherited from casacore::DataManager
static rownr_t MAXROWNR32
 Define the highest row number that can be represented as signed 32-bit. More...
 
- Protected Member Functions inherited from casacore::DataManager
void decrementNcolumn ()
 Decrement number of columns (in case a column is deleted). More...
 
void setEndian (Bool bigEndian)
 Tell the data manager if big or little endian format is needed. More...
 
void setTsmOption (const TSMOption &tsmOption)
 Tell the data manager which TSM option to use. More...
 
void setMultiFile (MultiFileBase *mfile)
 Tell the data manager that MultiFile can be used. More...
 
virtual Bool hasMultiFileSupport () const
 Does the data manager support use of MultiFile? A derived class has to return True if it can use the MultiFile. More...
 
void throwDataTypeOther (const String &columnName, int dataType) const
 Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns. More...
 

Detailed Description

Virtual column engine to return derived MS values.

Intended use:

Public interface

Review Status

Test programs:
tDerivedMSCal

Prerequisite

Synopsis

DerivedMSCal makes it possible to have virtual columns for the derived MeasurementSet values hourangle, parallactic angle, azimuth/elevation, and local sidereal time. In this way such derived values appear to be ordinary columns with the exception that no values can be put into them.

The following columns can be defined:

All columns have data type double and unit radian (except UVW). The HADEC, AZEL, ITRF and UVW columns are array columnns while the others are scalar columns.

This engine is meant for a MeasurementSet, but can be used for any table containing an ANTENNA and FIELD subtable and the relevant columns in the main table (ANTENNA1 and/or ANTENNA2, FIELD_ID, and TIME).
In principle the array center is the Observatory position, which is taken from the Measures Observatory table using the telescope name found in the OBSERVATION subtable. However, if the subtable is not defined or empty or if the telescope name is unknown, the position of the first antenna is used as the array position.

The engine can also be used for a CASA Calibration Table. It understands how it references the MeasurementSets. Because calibration tables contain no ANTENNA2 columns, columns XX2 are the same as XX1.

Motivation

It makes it possible to use generic table software (like querying, plotting, tablebrowser) on these values.

Example

The following example shows how to add such columns to an MS and use them thereafter.

// Open the table for update (to be able to add the columns).
Table tab ("tDerivedMSCal_tmp.tab", Table::Update);
// Define the columns and add them using DerivedMSCal.
TableDesc td;
td.addColumn (ScalarColumnDesc<double>("HA1"));
td.addColumn (ScalarColumnDesc<double>("HA2"));
td.addColumn (ScalarColumnDesc<double>("PA1"));
td.addColumn (ScalarColumnDesc<double>("PA2"));
DerivedMSCal dataMan;
tab.addColumn (td, dataMan);
// Print values of all rows.
ScalarColumn<double> ha1(tab, "HA1");
ScalarColumn<double> ha2(tab, "HA2");
ScalarColumn<double> pa1(tab, "PA1");
ScalarColumn<double> pa2(tab, "PA2");
for (rownr_t row=0; row<tab.nrow(); ++row) {
cout << ha1(row)<<' '<<ha2(row)<<' '<<pa1(row)<<' '<<pa2(row)<<endl;
}

To Do

Definition at line 133 of file DerivedMSCal.h.

Constructor & Destructor Documentation

casacore::DerivedMSCal::DerivedMSCal ( )

Create the data manager.

casacore::DerivedMSCal::DerivedMSCal ( const Record spec)
explicit

Create a Lofar storage manager with the given name.

The specifications are part of the record (as created by dataManagerSpec).

casacore::DerivedMSCal::~DerivedMSCal ( )
casacore::DerivedMSCal::DerivedMSCal ( const DerivedMSCal that)
private

Copy constructor cannot be used.

Member Function Documentation

virtual void casacore::DerivedMSCal::addColumn ( DataManagerColumn )
privatevirtual

Do the final addition of a column.

It won't do anything.

Reimplemented from casacore::DataManager.

virtual Bool casacore::DerivedMSCal::canAddColumn ( ) const
virtual

Columns can be added.

Reimplemented from casacore::DataManager.

virtual Bool casacore::DerivedMSCal::canRemoveColumn ( ) const
virtual

Columns can be removed.

Reimplemented from casacore::DataManager.

virtual DataManager* casacore::DerivedMSCal::clone ( ) const
virtual

Clone this object.

Implements casacore::DataManager.

virtual Record casacore::DerivedMSCal::dataManagerSpec ( ) const
virtual

Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

virtual String casacore::DerivedMSCal::dataManagerType ( ) const
virtual

Get the type name of the data manager (i.e.

DerivedMSCal).

Implements casacore::DataManager.

virtual DataManagerColumn* casacore::DerivedMSCal::makeIndArrColumn ( const String aName,
int  aDataType,
const String aDataTypeID 
)
privatevirtual

Create an indirect array column.

Reimplemented from casacore::VirtualColumnEngine.

static DataManager* casacore::DerivedMSCal::makeObject ( const String dataManName,
const Record spec 
)
static

Make the object from the type name string.

This function gets registered in the DataManager "constructor" map. The caller has to delete the object. The dataManName is not used.

virtual DataManagerColumn* casacore::DerivedMSCal::makeScalarColumn ( const String aName,
int  aDataType,
const String aDataTypeID 
)
privatevirtual

Create a column in the storage manager on behalf of a table column.

The caller has to delete the newly created object.

Create a scalar column.

Reimplemented from casacore::VirtualColumnEngine.

DerivedMSCal& casacore::DerivedMSCal::operator= ( const DerivedMSCal that)
private

Assignment cannot be used.

virtual void casacore::DerivedMSCal::prepare ( )
virtual

Prepare the object.

It sets the Table object in the engine.

Reimplemented from casacore::VirtualColumnEngine.

static void casacore::DerivedMSCal::registerClass ( )
static

Register the class name and the static makeObject "constructor".

This will make the engine known to the table system.

virtual void casacore::DerivedMSCal::removeColumn ( DataManagerColumn )
privatevirtual

Remove a column from the data file.

It won't do anything.

Reimplemented from casacore::DataManager.

Member Data Documentation

vector<DataManagerColumn*> casacore::DerivedMSCal::itsColumns
private

Definition at line 204 of file DerivedMSCal.h.

MSCalEngine casacore::DerivedMSCal::itsEngine
private

Definition at line 203 of file DerivedMSCal.h.


The documentation for this class was generated from the following file: