Virtual column engine to return derived MS values. More...
#include <DerivedMSCal.h>
Public Member Functions | |
DerivedMSCal () | |
Create the data manager. | |
DerivedMSCal (const Record &spec) | |
Create a Lofar storage manager with the given name. | |
~DerivedMSCal () | |
virtual DataManager * | clone () const |
Clone this object. | |
virtual void | prepare () |
Prepare the object. | |
virtual String | dataManagerType () const |
Get the type name of the data manager (i.e. | |
virtual Record | dataManagerSpec () const |
Record a record containing data manager specifications. | |
virtual Bool | canAddColumn () const |
Columns can be added. | |
virtual Bool | canRemoveColumn () const |
Columns can be removed. | |
Static Public Member Functions | |
static DataManager * | makeObject (const String &dataManName, const Record &spec) |
Make the object from the type name string. | |
static void | registerClass () |
Register the class name and the static makeObject "constructor". | |
Private Member Functions | |
DerivedMSCal (const DerivedMSCal &that) | |
Copy constructor cannot be used. | |
DerivedMSCal & | operator= (const DerivedMSCal &that) |
Assignment cannot be used. | |
virtual void | addColumn (DataManagerColumn *) |
Do the final addition of a column. | |
virtual void | removeColumn (DataManagerColumn *) |
Remove a column from the data file. | |
virtual DataManagerColumn * | makeScalarColumn (const String &aName, int aDataType, const String &aDataTypeID) |
Create a column in the storage manager on behalf of a table column. | |
virtual DataManagerColumn * | makeIndArrColumn (const String &aName, int aDataType, const String &aDataTypeID) |
Create an indirect array column. | |
Private Attributes | |
MSCalEngine | itsEngine |
vector< DataManagerColumn * > | itsColumns |
Virtual column engine to return derived MS values.
Public interface
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, 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.
It makes it possible to use generic table software (like querying, plotting, tablebrowser) on these values.
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 (uInt row=0; row<tab.nrow(); ++row) { cout << ha1(row)<<' '<<ha2(row)<<' '<<pa1(row)<<' '<<pa2(row)<<endl; }
Definition at line 130 of file DerivedMSCal.h.
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.
virtual void casacore::DerivedMSCal::addColumn | ( | DataManagerColumn * | ) | [private, virtual] |
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] |
virtual DataManagerColumn* casacore::DerivedMSCal::makeIndArrColumn | ( | const String & | aName, | |
int | aDataType, | |||
const String & | aDataTypeID | |||
) | [private, virtual] |
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 | |||
) | [private, virtual] |
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.
Reimplemented from casacore::VirtualColumnEngine.
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 * | ) | [private, virtual] |
vector<DataManagerColumn*> casacore::DerivedMSCal::itsColumns [private] |
Definition at line 201 of file DerivedMSCal.h.
MSCalEngine casacore::DerivedMSCal::itsEngine [private] |
Definition at line 200 of file DerivedMSCal.h.