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

More...

`#include <MSCalEngine.h>`

## Public Member Functions

| MSCalEngine ()
| Default constructor.
| ~MSCalEngine ()
| Destructor.
Table | getTable () const
| Get the table used.
void | setTable (const Table &)
| Use the given table (MS or CalTable) in the engine.
void | setDirection (const MDirection &)
| Set the direction to be used instead of a direction from the FIELD table.
void | setDirColName (const String &colName)
| Set the direction column name to use in the FIELD table.
double | getHA (Int antnr, rownr_t rownr)
| Get the hourangle for the given row.
void | getHaDec (Int antnr, rownr_t rownr, Array< Double > &)
| Get the hourangle/DEC for the given row.
double | getPA (Int antnr, rownr_t rownr)
| Get the parallatic angle for the given row.
double | getLAST (Int antnr, rownr_t rownr)
| Get the local sidereal time for the given row.
void | getAzEl (Int antnr, rownr_t rownr, Array< Double > &)
| Get the azimuth/elevation for the given row.
void | getItrf (Int antnr, rownr_t rownr, Array< Double > &)
| Get the ITRF coordinates for the given row.
void | getNewUVW (Bool asApp, rownr_t rownr, Array< Double > &)
| Get the UVW in J2000 or APP for the given row.
double | getDelay (Int antnr, rownr_t rownr)
| Get the delay for the given row.

## Private Member Functions

| MSCalEngine (const MSCalEngine &that)
| Copy constructor cannot be used.
MSCalEngine & | operator= (const MSCalEngine &that)
| Assignment cannot be used.
Int | setData (Int antnr, rownr_t rownr, Bool fillAnt=False)
| Set the data in the measure converter machines.
void | init ()
| Initialize the column objects, etc.
void | fillCalDesc ()
| Fill the CalDesc info for calibration tables.
void | fillAntPos (Int calDescId, Int calInx)
| Fill or update the antenna positions from the ANTENNA subtable at row calDescId.
void | fillFieldDir (Int calDescId, Int calInx)
| Fill or update the field directions from the FIELD subtable at row calDescId.
Table | getSubTable (Int calDescId, const String &subTabName, Bool mustExist=True)
| Get a calibration MS subtable for the given id.

## Private Attributes

Table | itsTable
Int | itsLastCalInx
Int | itsLastFieldId
Int | itsLastAntId
Double | itsLastTime
ScalarColumn< Int > | itsAntCol [2]
ScalarColumn< Int > | itsFeedCol [2]
ScalarColumn< Int > | itsFieldCol
ScalarColumn< Double > | itsTimeCol
ScalarMeasColumn< MEpoch > | itsTimeMeasCol
ScalarColumn< Int > | itsCalCol
map< string, int > | itsCalMap
vector< Int > | itsCalIdMap
MPosition | itsArrayPos
Vector< double > | itsArrayItrf
vector< vector< MPosition > > | itsAntPos
vector< vector< Int > > | itsMount
vector< vector< MDirection > > | itsFieldDir
Bool | itsReadFieldDir
String | itsDirColName
vector< vector< MBaseline > > | itsAntMB
vector< vector< Vector< double > > > | itsAntUvw
vector< Block< bool > > | itsUvwFilled
MDirection::Convert | itsRADecToAzEl
MDirection::Convert | itsPoleToAzEl
MDirection::Convert | itsRADecToHADec
MDirection::Convert | itsRADecToItrf
MDirection::Convert | itsDirToJ2000
MEpoch::Convert | itsUTCToLAST
MBaseline::Convert | itsBLToJ2000
MeasFrame | itsFrame
MDirection | itsLastDirJ2000

## Detailed Description

Engine to calculate derived MS values

### Intended use:

Public interface

### Review Status

Test programs:
  tDerivedMSCal

### Prerequisite

- MeasurementSet

### Synopsis

MSCalEngine is a class used to calculate derived MeasurementSet values hourangle, parallactic angle, azimuth/elevation, local sidereal time, and UVW coordinates. It is used by the DerivedMSCal virtual columns and UDFs, but can be used by other software as well.

The following values can be obtained:

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

All values have data type double and unit radian (except UVW). The HADEC, AZEL, ITRF and UVW cvalues are arrays while the others are scalars.

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). It also looks if columns FEED1 and/or FEED2 exist. They are not used yet, but might be in the future for support of multi-feed arrays.
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 or in the table keyword TELESCOPE_NAME. However, if the telescope name cannot be found or is unknown, the position of the middle antenna is used as the array position.

The new CASA Calibration Table format obeys the rules mentioned above, so these tables are fully supported. Note they do not contain an OBSERVATION subtable, but use keyword TELESCOPE_NAME.

The engine can also be used for old CASA Calibration Tables. It understands how they reference the MeasurementSets. Because these calibration tables contain no ANTENNA2 columns, columns XX2 are the same as XX1.

### Motivation

Factor out common code.

### To Do

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

Definition at line 116 of file MSCalEngine.h.

## Constructor & Destructor Documentation

## MSCalEngine() [1/2]

casacore::MSCalEngine::MSCalEngine | ( |  | ) |

Default constructor.

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

## ~MSCalEngine()

casacore::MSCalEngine::~MSCalEngine | ( |  | ) |

Destructor.

## MSCalEngine() [2/2]

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

private

Copy constructor cannot be used.

References MSCalEngine().

## Member Function Documentation

## fillAntPos()

void casacore::MSCalEngine::fillAntPos | ( | Int | calDescId,
|  | Int | calInx )

private

Fill or update the antenna positions from the ANTENNA subtable at row calDescId.

It is stored in the calInx-th entry of itsAntPos/itsMount.

## fillCalDesc()

void casacore::MSCalEngine::fillCalDesc | ( |  | ) |

private

Fill the CalDesc info for calibration tables.

## fillFieldDir()

void casacore::MSCalEngine::fillFieldDir | ( | Int | calDescId,
|  | Int | calInx )

private

Fill or update the field directions from the FIELD subtable at row calDescId.

It is stored in the calInx-th entry of itsFieldDir.

## getAzEl()

void casacore::MSCalEngine::getAzEl | ( | Int | antnr,
|  | rownr_t | rownr,
|  | Array< Double > & | )

Get the azimuth/elevation for the given row.

## getDelay()

double casacore::MSCalEngine::getDelay | ( | Int | antnr,
|  | rownr_t | rownr )

Get the delay for the given row.

## getHA()

double casacore::MSCalEngine::getHA | ( | Int | antnr,
|  | rownr_t | rownr )

Get the hourangle for the given row.

## getHaDec()

void casacore::MSCalEngine::getHaDec | ( | Int | antnr,
|  | rownr_t | rownr,
|  | Array< Double > & | )

Get the hourangle/DEC for the given row.

## getItrf()

void casacore::MSCalEngine::getItrf | ( | Int | antnr,
|  | rownr_t | rownr,
|  | Array< Double > & | )

Get the ITRF coordinates for the given row.

## getLAST()

double casacore::MSCalEngine::getLAST | ( | Int | antnr,
|  | rownr_t | rownr )

Get the local sidereal time for the given row.

## getNewUVW()

void casacore::MSCalEngine::getNewUVW | ( | Bool | asApp,
|  | rownr_t | rownr,
|  | Array< Double > & | )

Get the UVW in J2000 or APP for the given row.

## getPA()

double casacore::MSCalEngine::getPA | ( | Int | antnr,
|  | rownr_t | rownr )

Get the parallatic angle for the given row.

## getSubTable()

Table casacore::MSCalEngine::getSubTable | ( | Int | calDescId,
|  | const String & | subTabName,
|  | Bool | mustExist = True )

private

Get a calibration MS subtable for the given id.

References casacore::True.

## getTable()

Table casacore::MSCalEngine::getTable | ( |  | ) | const

inline

Get the table used.

Definition at line 126 of file MSCalEngine.h.

References itsTable.

## init()

void casacore::MSCalEngine::init | ( |  | ) |

private

Initialize the column objects, etc.

## operator=()

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

private

Assignment cannot be used.

References MSCalEngine().

## setData()

Int casacore::MSCalEngine::setData | ( | Int | antnr,
|  | rownr_t | rownr,
|  | Bool | fillAnt = False )

private

Set the data in the measure converter machines.

The antenna positions are only filled in antnr>=0 or if fillAnt is set. It returns the mount of the antenna.

References casacore::False.

## setDirColName()

void casacore::MSCalEngine::setDirColName | ( | const String & | colName | ) |

Set the direction column name to use in the FIELD table.

## setDirection()

void casacore::MSCalEngine::setDirection | ( | const MDirection & |  | ) |

Set the direction to be used instead of a direction from the FIELD table.

## setTable()

void casacore::MSCalEngine::setTable | ( | const Table & |  | ) |

Use the given table (MS or CalTable) in the engine.

## Member Data Documentation

## itsAntCol

ScalarColumn<Int> casacore::MSCalEngine::itsAntCol[2]

private

Definition at line 198 of file MSCalEngine.h.

## itsAntMB

vector<vector<MBaseline> > casacore::MSCalEngine::itsAntMB

private

Definition at line 213 of file MSCalEngine.h.

## itsAntPos

vector<vector<MPosition> > casacore::MSCalEngine::itsAntPos

private

Definition at line 208 of file MSCalEngine.h.

## itsAntUvw

vector<vector<Vector<double> > > casacore::MSCalEngine::itsAntUvw

private

Definition at line 214 of file MSCalEngine.h.

## itsArrayItrf

Vector<double> casacore::MSCalEngine::itsArrayItrf

private

Definition at line 207 of file MSCalEngine.h.

## itsArrayPos

MPosition casacore::MSCalEngine::itsArrayPos

private

Definition at line 206 of file MSCalEngine.h.

## itsBLToJ2000

MBaseline::Convert casacore::MSCalEngine::itsBLToJ2000

private

Definition at line 222 of file MSCalEngine.h.

## itsCalCol

ScalarColumn<Int> casacore::MSCalEngine::itsCalCol

private

Definition at line 203 of file MSCalEngine.h.

## itsCalIdMap

vector<Int> casacore::MSCalEngine::itsCalIdMap

private

Definition at line 205 of file MSCalEngine.h.

## itsCalMap

map<string,int> casacore::MSCalEngine::itsCalMap

private

Definition at line 204 of file MSCalEngine.h.

## itsDirColName

String casacore::MSCalEngine::itsDirColName

private

Definition at line 212 of file MSCalEngine.h.

## itsDirToJ2000

MDirection::Convert casacore::MSCalEngine::itsDirToJ2000

private

Definition at line 220 of file MSCalEngine.h.

## itsFeedCol

ScalarColumn<Int> casacore::MSCalEngine::itsFeedCol[2]

private

Definition at line 199 of file MSCalEngine.h.

## itsFieldCol

ScalarColumn<Int> casacore::MSCalEngine::itsFieldCol

private

Definition at line 200 of file MSCalEngine.h.

## itsFieldDir

vector<vector<MDirection> > casacore::MSCalEngine::itsFieldDir

private

Definition at line 210 of file MSCalEngine.h.

## itsFrame

MeasFrame casacore::MSCalEngine::itsFrame

private

Definition at line 223 of file MSCalEngine.h.

## itsLastAntId

Int casacore::MSCalEngine::itsLastAntId

private

Definition at line 196 of file MSCalEngine.h.

## itsLastCalInx

Int casacore::MSCalEngine::itsLastCalInx

private

Definition at line 194 of file MSCalEngine.h.

## itsLastDirJ2000

MDirection casacore::MSCalEngine::itsLastDirJ2000

private

Definition at line 224 of file MSCalEngine.h.

## itsLastFieldId

Int casacore::MSCalEngine::itsLastFieldId

private

Definition at line 195 of file MSCalEngine.h.

## itsLastTime

Double casacore::MSCalEngine::itsLastTime

private

Definition at line 197 of file MSCalEngine.h.

## itsMount

vector<vector<Int> > casacore::MSCalEngine::itsMount

private

Definition at line 209 of file MSCalEngine.h.

## itsPoleToAzEl

MDirection::Convert casacore::MSCalEngine::itsPoleToAzEl

private

Definition at line 217 of file MSCalEngine.h.

## itsRADecToAzEl

MDirection::Convert casacore::MSCalEngine::itsRADecToAzEl

private

Definition at line 216 of file MSCalEngine.h.

## itsRADecToHADec

MDirection::Convert casacore::MSCalEngine::itsRADecToHADec

private

Definition at line 218 of file MSCalEngine.h.

## itsRADecToItrf

MDirection::Convert casacore::MSCalEngine::itsRADecToItrf

private

Definition at line 219 of file MSCalEngine.h.

## itsReadFieldDir

Bool casacore::MSCalEngine::itsReadFieldDir

private

Definition at line 211 of file MSCalEngine.h.

## itsTable

Table casacore::MSCalEngine::itsTable

private

Definition at line 193 of file MSCalEngine.h.

Referenced by getTable().

## itsTimeCol

ScalarColumn<Double> casacore::MSCalEngine::itsTimeCol

private

Definition at line 201 of file MSCalEngine.h.

## itsTimeMeasCol

ScalarMeasColumn<MEpoch> casacore::MSCalEngine::itsTimeMeasCol

private

Definition at line 202 of file MSCalEngine.h.

## itsUTCToLAST

MEpoch::Convert casacore::MSCalEngine::itsUTCToLAST

private

Definition at line 221 of file MSCalEngine.h.

## itsUvwFilled

vector<Block<bool> > casacore::MSCalEngine::itsUvwFilled

private

Definition at line 215 of file MSCalEngine.h.

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

- derivedmscal/DerivedMC/MSCalEngine.h