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

List of all members.

Public Member Functions

 DerivedMSCal ()
 Create the data manager.
 DerivedMSCal (const Record &spec)
 Create a Lofar storage manager with the given name.
 ~DerivedMSCal ()
virtual DataManagerclone () 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 DataManagermakeObject (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.
DerivedMSCaloperator= (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 DataManagerColumnmakeScalarColumn (const String &aName, int aDataType, const String &aDataTypeID)
 Create a column in the storage manager on behalf of a table column.
virtual DataManagerColumnmakeIndArrColumn (const String &aName, int aDataType, const String &aDataTypeID)
 Create an indirect array column.

Private Attributes

MSCalEngine itsEngine
vector< DataManagerColumn * > itsColumns

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, 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 (uInt row=0; row<tab.nrow(); ++row) {
 cout << ha1(row)<<' '<<ha2(row)<<' '<<pa1(row)<<' '<<pa2(row)<<endl;
 }

To Do

Definition at line 130 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  )  [private, virtual]

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 
) [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]

Remove a column from the data file.

It won't do anything.

Reimplemented from casacore::DataManager.


Member Data Documentation

Definition at line 201 of file DerivedMSCal.h.

Definition at line 200 of file DerivedMSCal.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1