Loading...
Searching...
No Matches
casacore::DerivedMSCal Class Reference
derivedmscal package (libcasa_derivedmscal) » DerivedMC_module

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.
Public Member Functions inherited from casacore::VirtualColumnEngine
| VirtualColumnEngine ()
| Create the object.
virtual | ~VirtualColumnEngine ()
| VirtualColumnEngine (const VirtualColumnEngine &)=delete
| The copy constructor cannot be used for this base class.
VirtualColumnEngine & | operator= (const VirtualColumnEngine &)=delete
| Assignment cannot be used for this base class.
Public Member Functions inherited from casacore::DataManager
| DataManager ()
| Default constructor.
virtual | ~DataManager ()
| DataManager (const DataManager &)=delete
| The copy constructor cannot be used for this base class.
DataManager & | operator= (const DataManager &)=delete
| Assignment cannot be used for this base class.
virtual String | dataManagerName () const
| Return the name of the data manager.
void | dataManagerInfo (Record &info) const
| Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
virtual Record | getProperties () const
| Get data manager properties that can be modified.
virtual void | setProperties (const Record &spec)
| Modify data manager properties given in record fields.
virtual Bool | canReallocateColumns () const
| Tell if the data manager wants to reallocate the data manager column objects.
virtual DataManagerColumn * | reallocateColumn (DataManagerColumn *column)
| Reallocate the column object if it is part of this data manager.
uInt | sequenceNr () const
| Get the (unique) sequence nr of this data manager.
uInt | ncolumn () const
| Get the nr of columns in this data manager (can be zero).
Bool | asBigEndian () const
| Have the data to be stored in big or little endian canonical format?
const TSMOption & | tsmOption () const
| Get the TSM option.
std::shared_ptr< MultiFileBase > | multiFile ()
| Get the MultiFile pointer (can be 0).
String | keywordName (const String &keyword) const
| Compose a keyword name from the given keyword appended with the sequence number (e.g.
String | fileName () const
| Compose a unique filename from the table name and sequence number.
ByteIO::OpenOption | fileOption () const
| Get the AipsIO option of the underlying file.
virtual Bool | isRegular () const
| Is this a regular storage manager?
Table & | table () const
| Get the table this object is associated with.
virtual void | reopenRW ()
| Reopen the data manager for read/write access.
virtual Bool | canRenameColumn () const
| Does the data manager allow to rename columns?
virtual void | setMaximumCacheSize (uInt nMiB)
| Set the maximum cache size (in bytes) to be used by a storage manager.
virtual void | showCacheStatistics (std::ostream &) const
| Show the data manager's IO statistics.
DataManagerColumn * | createScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a column in the data manager on behalf of a table column.
DataManagerColumn * | createDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a direct array column.
DataManagerColumn * | createIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create an indirect array column.
DataManager * | getClone () const
| Has the object already been cloned?
void | setClone (DataManager *clone) const
| Set the pointer to the clone.

## 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".
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.
static DataManagerCtor | getCtor (const String &dataManagerType)
| Get the "constructor" of a data manager (thread-safe).
static Bool | isRegistered (const String &dataManagerType)
| Test if a data manager is registered (thread-safe).
static DataManager * | unknownDataManager (const String &dataManagerType, const Record &spec)
| Serve as default function for theirRegisterMap, which catches all unknown data manager types.

## 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

## 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.
Protected Member Functions inherited from casacore::DataManager
void | decrementNcolumn ()
| Decrement number of columns (in case a column is deleted).
void | setEndian (Bool bigEndian)
| Tell the data manager if big or little endian format is needed.
void | setTsmOption (const TSMOption &tsmOption)
| Tell the data manager which TSM option to use.
void | setMultiFile (const std::shared_ptr< MultiFileBase > &mfile)
| Tell the data manager that MultiFile can be used.
virtual Bool | hasMultiFileSupport () const
| Does the data manager support use of MultiFile?
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.

## Detailed Description

Virtual column engine to return derived MS values

### Intended use:

Public interface

### Review Status

Test programs:
  tDerivedMSCal

### Prerequisite

- The Table Data Managers concept as described in module file Tables.h
- MeasurementSet

### 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:

- HA is the hourangle of the pointing from the array center (observatory position).
- HA1 is the hourangle of the pointing from ANTENNA1.
- HA2 is the hourangle of the pointing from ANTENNA2.
- HADEC is the hourangle/DEC of the pointing from the array center (observatory position).
- HADEC1 is the hourangle/DEC of the pointing from ANTENNA1.
- HADEC2 is the hourangle/DEC of the pointing from ANTENNA2.
- LAST is the local sidereal time of the pointing from the array center.
- LAST1 is the local sidereal time of the pointing from ANTENNA1.
- LAST2 is the local sidereal time of the pointing from ANTENNA2.
- PA1 is the parallactic angle of the pointing from ANTENNA1.
- PA2 is the parallactic angle of the pointing from ANTENNA2.
- AZEL is the azimuth/elevation of the pointing from the array center.
- AZEL1 is the azimuth/elevation of the pointing from ANTENNA1.
- AZEL2 is the azimuth/elevation of the pointing from ANTENNA2.
- ITRF is the pointing in (time-dependent) ITRF coordinates.
- UVW_J2000 is the UVW coordinates in J2000 (in meters).

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;
}
casacore::DerivedMSCal::DerivedMSCal
DerivedMSCal()
Create the data manager.
casacore::ScalarColumnDesc
Definition ScaColDesc.h:162
casacore::ScalarColumn
Definition ScalarColumn.h:83
casacore::TableDesc
Definition TableDesc.h:189
casacore::TableDesc::addColumn
ColumnDesc & addColumn(const ColumnDesc &)
Add a column to the table description.
Definition TableDesc.h:568
casacore::Table
Definition Table.h:157
casacore::Table::Update
@ Update
update existing table
Definition Table.h:181
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44

### To Do

- Take care of the feeds and their offsets.
- Have a conversion engine per field/antenna/feed?

Definition at line 131 of file DerivedMSCal.h.

## Constructor & Destructor Documentation

## DerivedMSCal() [1/3]

casacore::DerivedMSCal::DerivedMSCal | ( |  | ) |

Create the data manager.

Referenced by DerivedMSCal(), and operator=().

## DerivedMSCal() [2/3]

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).

References casacore::Record().

## ~DerivedMSCal()

casacore::DerivedMSCal::~DerivedMSCal | ( |  | ) |

## DerivedMSCal() [3/3]

casacore::DerivedMSCal::DerivedMSCal | ( | const DerivedMSCal & | that | ) |

private

Copy constructor cannot be used.

References DerivedMSCal().

## Member Function Documentation

## addColumn()

virtual void casacore::DerivedMSCal::addColumn | ( | DataManagerColumn * |  | ) |

private virtual

Do the final addition of a column.

It won't do anything.

Reimplemented from casacore::DataManager.

## canAddColumn()

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

virtual

Columns can be added.

Reimplemented from casacore::DataManager.

## canRemoveColumn()

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

virtual

Columns can be removed.

Reimplemented from casacore::DataManager.

## clone()

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

virtual

Clone this object.

Implements casacore::DataManager.

## dataManagerSpec()

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

virtual

Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

References casacore::Record().

## dataManagerType()

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

virtual

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

DerivedMSCal).

Implements casacore::DataManager.

## makeIndArrColumn()

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

private virtual

Create an indirect array column.

Reimplemented from casacore::VirtualColumnEngine.

## makeObject()

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.

References casacore::Record().

## makeScalarColumn()

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.

## operator=()

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

private

Assignment cannot be used.

References DerivedMSCal().

## prepare()

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

virtual

Prepare the object.

It sets the Table object in the engine.

Reimplemented from casacore::VirtualColumnEngine.

## registerClass()

void casacore::DerivedMSCal::registerClass | ( |  | ) |

static

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

This will make the engine known to the table system.

## removeColumn()

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

## itsColumns

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

private

Definition at line 202 of file DerivedMSCal.h.

## itsEngine

MSCalEngine casacore::DerivedMSCal::itsEngine

private

Definition at line 201 of file DerivedMSCal.h.

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

- derivedmscal/DerivedMC/DerivedMSCal.h