casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::MSCalEngine Class Reference

More...

#include <MSCalEngine.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

Table itsTable
 
Int itsLastCalInx
 
Int itsLastFieldId
 
Int itsLastAntId
 
Double itsLastTime
 
ScalarColumn< IntitsAntCol [2]
 
ScalarColumn< IntitsFeedCol [2]
 
ScalarColumn< IntitsFieldCol
 
ScalarColumn< DoubleitsTimeCol
 
ScalarMeasColumn< MEpochitsTimeMeasCol
 
ScalarColumn< IntitsCalCol
 
map< string, int > itsCalMap
 
vector< IntitsCalIdMap
 
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

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:

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

Definition at line 118 of file MSCalEngine.h.

Constructor & Destructor Documentation

◆ MSCalEngine() [1/2]

casacore::MSCalEngine::MSCalEngine ( )

Default constructor.

◆ ~MSCalEngine()

casacore::MSCalEngine::~MSCalEngine ( )

Destructor.

◆ MSCalEngine() [2/2]

casacore::MSCalEngine::MSCalEngine ( const MSCalEngine that)
private

Copy constructor cannot be used.

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.

◆ getTable()

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

Get the table used.

Definition at line 128 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.

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

◆ 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 200 of file MSCalEngine.h.

◆ itsAntMB

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

Definition at line 215 of file MSCalEngine.h.

◆ itsAntPos

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

Definition at line 210 of file MSCalEngine.h.

◆ itsAntUvw

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

Definition at line 216 of file MSCalEngine.h.

◆ itsArrayItrf

Vector<double> casacore::MSCalEngine::itsArrayItrf
private

Definition at line 209 of file MSCalEngine.h.

◆ itsArrayPos

MPosition casacore::MSCalEngine::itsArrayPos
private

Definition at line 208 of file MSCalEngine.h.

◆ itsBLToJ2000

MBaseline::Convert casacore::MSCalEngine::itsBLToJ2000
private

Definition at line 224 of file MSCalEngine.h.

◆ itsCalCol

ScalarColumn<Int> casacore::MSCalEngine::itsCalCol
private

Definition at line 205 of file MSCalEngine.h.

◆ itsCalIdMap

vector<Int> casacore::MSCalEngine::itsCalIdMap
private

Definition at line 207 of file MSCalEngine.h.

◆ itsCalMap

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

Definition at line 206 of file MSCalEngine.h.

◆ itsDirColName

String casacore::MSCalEngine::itsDirColName
private

Definition at line 214 of file MSCalEngine.h.

◆ itsDirToJ2000

MDirection::Convert casacore::MSCalEngine::itsDirToJ2000
private

Definition at line 222 of file MSCalEngine.h.

◆ itsFeedCol

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

Definition at line 201 of file MSCalEngine.h.

◆ itsFieldCol

ScalarColumn<Int> casacore::MSCalEngine::itsFieldCol
private

Definition at line 202 of file MSCalEngine.h.

◆ itsFieldDir

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

Definition at line 212 of file MSCalEngine.h.

◆ itsFrame

MeasFrame casacore::MSCalEngine::itsFrame
private

Definition at line 225 of file MSCalEngine.h.

◆ itsLastAntId

Int casacore::MSCalEngine::itsLastAntId
private

Definition at line 198 of file MSCalEngine.h.

◆ itsLastCalInx

Int casacore::MSCalEngine::itsLastCalInx
private

Definition at line 196 of file MSCalEngine.h.

◆ itsLastDirJ2000

MDirection casacore::MSCalEngine::itsLastDirJ2000
private

Definition at line 226 of file MSCalEngine.h.

◆ itsLastFieldId

Int casacore::MSCalEngine::itsLastFieldId
private

Definition at line 197 of file MSCalEngine.h.

◆ itsLastTime

Double casacore::MSCalEngine::itsLastTime
private

Definition at line 199 of file MSCalEngine.h.

◆ itsMount

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

Definition at line 211 of file MSCalEngine.h.

◆ itsPoleToAzEl

MDirection::Convert casacore::MSCalEngine::itsPoleToAzEl
private

Definition at line 219 of file MSCalEngine.h.

◆ itsRADecToAzEl

MDirection::Convert casacore::MSCalEngine::itsRADecToAzEl
private

Definition at line 218 of file MSCalEngine.h.

◆ itsRADecToHADec

MDirection::Convert casacore::MSCalEngine::itsRADecToHADec
private

Definition at line 220 of file MSCalEngine.h.

◆ itsRADecToItrf

MDirection::Convert casacore::MSCalEngine::itsRADecToItrf
private

Definition at line 221 of file MSCalEngine.h.

◆ itsReadFieldDir

Bool casacore::MSCalEngine::itsReadFieldDir
private

Definition at line 213 of file MSCalEngine.h.

◆ itsTable

Table casacore::MSCalEngine::itsTable
private

Definition at line 195 of file MSCalEngine.h.

Referenced by getTable().

◆ itsTimeCol

ScalarColumn<Double> casacore::MSCalEngine::itsTimeCol
private

Definition at line 203 of file MSCalEngine.h.

◆ itsTimeMeasCol

ScalarMeasColumn<MEpoch> casacore::MSCalEngine::itsTimeMeasCol
private

Definition at line 204 of file MSCalEngine.h.

◆ itsUTCToLAST

MEpoch::Convert casacore::MSCalEngine::itsUTCToLAST
private

Definition at line 223 of file MSCalEngine.h.

◆ itsUvwFilled

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

Definition at line 217 of file MSCalEngine.h.


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