casacore
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members

More...

#include <UDFMSCal.h>

Public Types

enum  ColType {
  HA ,
  HADEC ,
  PA ,
  LAST ,
  AZEL ,
  ITRF ,
  UVWWVL ,
  UVWWVLS ,
  NEWUVW ,
  NEWUVWWVL ,
  NEWUVWWVLS ,
  DELAY ,
  STOKES ,
  SELECTION ,
  GETVALUE
}
 Define the possible 'column' types. More...
 
enum  SelType {
  BASELINE ,
  CORR ,
  TIME ,
  UVDIST ,
  SPW ,
  FIELD ,
  FEED ,
  ARRAY ,
  SCAN ,
  STATE ,
  OBS
}
 Define the possible selection types. More...
 
- Public Types inherited from casacore::UDFBase
typedef UDFBaseMakeUDFObject(const String &functionName)
 The signature of a global or static member function creating an object of the UDF. More...
 

Public Member Functions

 UDFMSCal (ColType, Int arg)
 Create object the given ColType and SelType. More...
 
 UDFMSCal (const String &funcName)
 Create the object for getting a value from a column in a subtable. More...
 
 UDFMSCal (const String &funcName, const String &subtabName, const String &idColName, Int arg=0)
 
 UDFMSCal (const String &funcName, const String &subtabName, const String &idColName, const String &colName)
 
virtual void setup (const Table &, const TaQLStyle &)
 Setup the object. More...
 
virtual Bool getBool (const TableExprId &id)
 Get the value. More...
 
virtual Int64 getInt (const TableExprId &id)
 
virtual Double getDouble (const TableExprId &id)
 
virtual DComplex getDComplex (const TableExprId &id)
 
virtual String getString (const TableExprId &id)
 
virtual MArray< BoolgetArrayBool (const TableExprId &id)
 
virtual MArray< Int64getArrayInt (const TableExprId &id)
 
virtual MArray< DoublegetArrayDouble (const TableExprId &id)
 
virtual MArray< DComplex > getArrayDComplex (const TableExprId &id)
 
virtual MArray< StringgetArrayString (const TableExprId &id)
 
virtual void recreateColumnObjects (const Vector< rownr_t > &rownrs)
 Let a derived class recreate its column objects in case a selection has to be applied. More...
 
- Public Member Functions inherited from casacore::UDFBase
 UDFBase ()
 Only default constructor is needed. More...
 
virtual ~UDFBase ()
 Destructor. More...
 
virtual TaqlRegex getRegex (const TableExprId &id)
 
virtual MVTime getDate (const TableExprId &id)
 
virtual MArray< MVTimegetArrayDate (const TableExprId &id)
 
const StringgetUnit () const
 Get the unit. More...
 
const RecordgetAttributes () const
 Get the attributes. More...
 
void getAggrNodes (vector< TableExprNodeRep * > &aggr)
 Get the nodes in the function operands representing an aggregate function. More...
 
void getColumnNodes (vector< TableExprNodeRep * > &cols)
 Get the nodes in the function operands representing a table column. More...
 
void init (const std::vector< TENShPtr > &arg, const Table &table, const TaQLStyle &)
 Initialize the function object. More...
 
TableExprNodeRep::NodeDataType dataType () const
 Get the data type. More...
 
Int ndim () const
 Get the dimensionality of the results. More...
 
const IPositionshape () const
 Get the result shape if the same for all results. More...
 
Bool isConstant () const
 Tell if the UDF gives a constant result. More...
 
Bool isAggregate () const
 Tell if the UDF is an aggregate function. More...
 
void disableApplySelection ()
 Do not apply the selection. More...
 
void applySelection (const Vector< rownr_t > &rownrs)
 If needed, let the UDF re-create column objects for a selection of rows. More...
 

Static Public Member Functions

static UDFBasemakeHA (const String &)
 Function to create an object. More...
 
static UDFBasemakeHA1 (const String &)
 
static UDFBasemakeHA2 (const String &)
 
static UDFBasemakeHADEC (const String &)
 
static UDFBasemakeHADEC1 (const String &)
 
static UDFBasemakeHADEC2 (const String &)
 
static UDFBasemakePA1 (const String &)
 
static UDFBasemakePA2 (const String &)
 
static UDFBasemakeLAST (const String &)
 
static UDFBasemakeLAST1 (const String &)
 
static UDFBasemakeLAST2 (const String &)
 
static UDFBasemakeAZEL (const String &)
 
static UDFBasemakeAZEL1 (const String &)
 
static UDFBasemakeAZEL2 (const String &)
 
static UDFBasemakeITRF (const String &)
 
static UDFBasemakeUvwWvl (const String &)
 
static UDFBasemakeUvwWvls (const String &)
 
static UDFBasemakeUvwJ2000 (const String &)
 
static UDFBasemakeWvlJ2000 (const String &)
 
static UDFBasemakeWvlsJ2000 (const String &)
 
static UDFBasemakeUvwAPP (const String &)
 
static UDFBasemakeWvlAPP (const String &)
 
static UDFBasemakeWvlsAPP (const String &)
 
static UDFBasemakeDelay (const String &)
 
static UDFBasemakeDelay1 (const String &)
 
static UDFBasemakeDelay2 (const String &)
 
static UDFBasemakeStokes (const String &)
 
static UDFBasemakeBaseline (const String &)
 
static UDFBasemakeCorr (const String &)
 
static UDFBasemakeTime (const String &)
 
static UDFBasemakeUVDist (const String &)
 
static UDFBasemakeSpw (const String &)
 
static UDFBasemakeField (const String &)
 
static UDFBasemakeFeed (const String &)
 
static UDFBasemakeArray (const String &)
 
static UDFBasemakeScan (const String &)
 
static UDFBasemakeState (const String &)
 
static UDFBasemakeObs (const String &)
 
static UDFBasemakeAnt1Name (const String &)
 
static UDFBasemakeAnt2Name (const String &)
 
static UDFBasemakeAnt1Col (const String &)
 
static UDFBasemakeAnt2Col (const String &)
 
static UDFBasemakeStateCol (const String &)
 
static UDFBasemakeObsCol (const String &)
 
static UDFBasemakeSpwCol (const String &)
 
static UDFBasemakePolCol (const String &)
 
static UDFBasemakeFieldCol (const String &)
 
static UDFBasemakeProcCol (const String &)
 
static UDFBasemakeSubCol (const String &)
 
- Static Public Member Functions inherited from casacore::UDFBase
static void registerUDF (const String &name, MakeUDFObject *func)
 Register the name and construction function of a UDF (thread-safe). More...
 
static UDFBasecreateUDF (const String &name, const TaQLStyle &style)
 Create a UDF object (thread-safe). More...
 

Private Member Functions

void setupStokes (const Table &table, std::vector< TENShPtr > &operands)
 Setup the Stokes conversion. More...
 
void setupSelection (const Table &table, std::vector< TENShPtr > &operands)
 Setup the baseline selection. More...
 
void setupDir (TENShPtr &operand)
 Setup direction conversion if a direction is explicitly given. More...
 
void setupGetValue (const Table &table, std::vector< TENShPtr > &operands)
 Setup getting column values from a subtable. More...
 
void setupWvls (const Table &table, std::vector< TENShPtr > &operands, uInt nargMax)
 Setup getting the wavelength information. More...
 
Int64 getRowNr (const TableExprId &id)
 Get the rownr in the subtable for GetValue. More...
 
Array< DoubletoWvls (const TableExprId &)
 Convert the UVW coordinates to wavelengths for the full spectrum. More...
 

Private Attributes

MSCalEngine itsEngine
 
StokesConverter itsStokesConv
 
TableExprNode itsDataNode
 
TableExprNode itsIdNode
 
ArrayColumn< DoubleitsUvwCol
 
ColType itsType
 
Int itsArg
 
String itsFuncName
 
String itsSubTabName
 
String itsIdColName
 
String itsSubColName
 
Vector< DoubleitsTmpVector
 
Array< DoubleitsTmpUvwWvl
 
Vector< IntitsDDIds
 
vector< DoubleitsWavel
 
vector< Vector< Double > > itsWavels
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::UDFBase
std::vector< TENShPtr > & operands ()
 Get the operands. More...
 
void setDataType (TableExprNodeRep::NodeDataType)
 Set the data type. More...
 
void setNDim (Int ndim)
 Set the dimensionality of the results. More...
 
void setShape (const IPosition &shape)
 Set the shape of the results if it is fixed and known. More...
 
void setUnit (const String &unit)
 Set the unit of the result. More...
 
void setAttributes (const Record &attributes)
 Set the attributes of the result. More...
 
void setConstant (Bool isConstant)
 Define if the result is constant (e.g. More...
 
void setAggregate (Bool isAggregate)
 Define if the UDF is an aggregate function (usually used in GROUPBY). More...
 

Detailed Description

TaQL UDFs to calculate derived MS values.

Intended use:

Public interface

Review Status

Test programs:
tDerivedMSCal

Prerequisite

Synopsis

UDFMSCal defines UDFs (user defined functions) that can be used in TaQL to get derived MeasurementSet values hourangle, parallactic angle, azimuth/elevation, and local sidereal time. In this way such derived values appear to be ordinary TaQL functions.

The following functions can be defined:

The first functions have data type double and unit radian (except UVW). The HADEC, AZEL, and UVW functions return arrays while the others return scalars.
The STOKES function can have data type Complex, Double or Bool.
The latter functions are selection functions and return a Bool scalar.

This class 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, functions XX2 are the same as XX1.

Motivation

It makes it possible to do queries on these values without having to add columns for them.

Definition at line 117 of file UDFMSCal.h.

Member Enumeration Documentation

◆ ColType

Define the possible 'column' types.

Enumerator
HA 
HADEC 
PA 
LAST 
AZEL 
ITRF 
UVWWVL 
UVWWVLS 
NEWUVW 
NEWUVWWVL 
NEWUVWWVLS 
DELAY 
STOKES 
SELECTION 
GETVALUE 

Definition at line 121 of file UDFMSCal.h.

◆ SelType

Define the possible selection types.

Enumerator
BASELINE 
CORR 
TIME 
UVDIST 
SPW 
FIELD 
FEED 
ARRAY 
SCAN 
STATE 
OBS 

Definition at line 125 of file UDFMSCal.h.

Constructor & Destructor Documentation

◆ UDFMSCal() [1/4]

casacore::UDFMSCal::UDFMSCal ( ColType  ,
Int  arg 
)

Create object the given ColType and SelType.

◆ UDFMSCal() [2/4]

casacore::UDFMSCal::UDFMSCal ( const String funcName)
explicit

Create the object for getting a value from a column in a subtable.

◆ UDFMSCal() [3/4]

casacore::UDFMSCal::UDFMSCal ( const String funcName,
const String subtabName,
const String idColName,
Int  arg = 0 
)

◆ UDFMSCal() [4/4]

casacore::UDFMSCal::UDFMSCal ( const String funcName,
const String subtabName,
const String idColName,
const String colName 
)

Member Function Documentation

◆ getArrayBool()

virtual MArray<Bool> casacore::UDFMSCal::getArrayBool ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getArrayDComplex()

virtual MArray<DComplex> casacore::UDFMSCal::getArrayDComplex ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getArrayDouble()

virtual MArray<Double> casacore::UDFMSCal::getArrayDouble ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getArrayInt()

virtual MArray<Int64> casacore::UDFMSCal::getArrayInt ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getArrayString()

virtual MArray<String> casacore::UDFMSCal::getArrayString ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getBool()

virtual Bool casacore::UDFMSCal::getBool ( const TableExprId id)
virtual

Get the value.

Reimplemented from casacore::UDFBase.

◆ getDComplex()

virtual DComplex casacore::UDFMSCal::getDComplex ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getDouble()

virtual Double casacore::UDFMSCal::getDouble ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getInt()

virtual Int64 casacore::UDFMSCal::getInt ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ getRowNr()

Int64 casacore::UDFMSCal::getRowNr ( const TableExprId id)
private

Get the rownr in the subtable for GetValue.

If itsArg==1 it uses indirection using itsDDIds.

◆ getString()

virtual String casacore::UDFMSCal::getString ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

◆ makeAnt1Col()

static UDFBase* casacore::UDFMSCal::makeAnt1Col ( const String )
static

◆ makeAnt1Name()

static UDFBase* casacore::UDFMSCal::makeAnt1Name ( const String )
static

◆ makeAnt2Col()

static UDFBase* casacore::UDFMSCal::makeAnt2Col ( const String )
static

◆ makeAnt2Name()

static UDFBase* casacore::UDFMSCal::makeAnt2Name ( const String )
static

◆ makeArray()

static UDFBase* casacore::UDFMSCal::makeArray ( const String )
static

◆ makeAZEL()

static UDFBase* casacore::UDFMSCal::makeAZEL ( const String )
static

◆ makeAZEL1()

static UDFBase* casacore::UDFMSCal::makeAZEL1 ( const String )
static

◆ makeAZEL2()

static UDFBase* casacore::UDFMSCal::makeAZEL2 ( const String )
static

◆ makeBaseline()

static UDFBase* casacore::UDFMSCal::makeBaseline ( const String )
static

◆ makeCorr()

static UDFBase* casacore::UDFMSCal::makeCorr ( const String )
static

◆ makeDelay()

static UDFBase* casacore::UDFMSCal::makeDelay ( const String )
static

◆ makeDelay1()

static UDFBase* casacore::UDFMSCal::makeDelay1 ( const String )
static

◆ makeDelay2()

static UDFBase* casacore::UDFMSCal::makeDelay2 ( const String )
static

◆ makeFeed()

static UDFBase* casacore::UDFMSCal::makeFeed ( const String )
static

◆ makeField()

static UDFBase* casacore::UDFMSCal::makeField ( const String )
static

◆ makeFieldCol()

static UDFBase* casacore::UDFMSCal::makeFieldCol ( const String )
static

◆ makeHA()

static UDFBase* casacore::UDFMSCal::makeHA ( const String )
static

Function to create an object.

◆ makeHA1()

static UDFBase* casacore::UDFMSCal::makeHA1 ( const String )
static

◆ makeHA2()

static UDFBase* casacore::UDFMSCal::makeHA2 ( const String )
static

◆ makeHADEC()

static UDFBase* casacore::UDFMSCal::makeHADEC ( const String )
static

◆ makeHADEC1()

static UDFBase* casacore::UDFMSCal::makeHADEC1 ( const String )
static

◆ makeHADEC2()

static UDFBase* casacore::UDFMSCal::makeHADEC2 ( const String )
static

◆ makeITRF()

static UDFBase* casacore::UDFMSCal::makeITRF ( const String )
static

◆ makeLAST()

static UDFBase* casacore::UDFMSCal::makeLAST ( const String )
static

◆ makeLAST1()

static UDFBase* casacore::UDFMSCal::makeLAST1 ( const String )
static

◆ makeLAST2()

static UDFBase* casacore::UDFMSCal::makeLAST2 ( const String )
static

◆ makeObs()

static UDFBase* casacore::UDFMSCal::makeObs ( const String )
static

◆ makeObsCol()

static UDFBase* casacore::UDFMSCal::makeObsCol ( const String )
static

◆ makePA1()

static UDFBase* casacore::UDFMSCal::makePA1 ( const String )
static

◆ makePA2()

static UDFBase* casacore::UDFMSCal::makePA2 ( const String )
static

◆ makePolCol()

static UDFBase* casacore::UDFMSCal::makePolCol ( const String )
static

◆ makeProcCol()

static UDFBase* casacore::UDFMSCal::makeProcCol ( const String )
static

◆ makeScan()

static UDFBase* casacore::UDFMSCal::makeScan ( const String )
static

◆ makeSpw()

static UDFBase* casacore::UDFMSCal::makeSpw ( const String )
static

◆ makeSpwCol()

static UDFBase* casacore::UDFMSCal::makeSpwCol ( const String )
static

◆ makeState()

static UDFBase* casacore::UDFMSCal::makeState ( const String )
static

◆ makeStateCol()

static UDFBase* casacore::UDFMSCal::makeStateCol ( const String )
static

◆ makeStokes()

static UDFBase* casacore::UDFMSCal::makeStokes ( const String )
static

◆ makeSubCol()

static UDFBase* casacore::UDFMSCal::makeSubCol ( const String )
static

◆ makeTime()

static UDFBase* casacore::UDFMSCal::makeTime ( const String )
static

◆ makeUVDist()

static UDFBase* casacore::UDFMSCal::makeUVDist ( const String )
static

◆ makeUvwAPP()

static UDFBase* casacore::UDFMSCal::makeUvwAPP ( const String )
static

◆ makeUvwJ2000()

static UDFBase* casacore::UDFMSCal::makeUvwJ2000 ( const String )
static

◆ makeUvwWvl()

static UDFBase* casacore::UDFMSCal::makeUvwWvl ( const String )
static

◆ makeUvwWvls()

static UDFBase* casacore::UDFMSCal::makeUvwWvls ( const String )
static

◆ makeWvlAPP()

static UDFBase* casacore::UDFMSCal::makeWvlAPP ( const String )
static

◆ makeWvlJ2000()

static UDFBase* casacore::UDFMSCal::makeWvlJ2000 ( const String )
static

◆ makeWvlsAPP()

static UDFBase* casacore::UDFMSCal::makeWvlsAPP ( const String )
static

◆ makeWvlsJ2000()

static UDFBase* casacore::UDFMSCal::makeWvlsJ2000 ( const String )
static

◆ recreateColumnObjects()

virtual void casacore::UDFMSCal::recreateColumnObjects ( const Vector< rownr_t > &  rownrs)
virtual

Let a derived class recreate its column objects in case a selection has to be applied.

Reimplemented from casacore::UDFBase.

◆ setup()

virtual void casacore::UDFMSCal::setup ( const Table ,
const TaQLStyle  
)
virtual

Setup the object.

Implements casacore::UDFBase.

◆ setupDir()

void casacore::UDFMSCal::setupDir ( TENShPtr operand)
private

Setup direction conversion if a direction is explicitly given.

◆ setupGetValue()

void casacore::UDFMSCal::setupGetValue ( const Table table,
std::vector< TENShPtr > &  operands 
)
private

Setup getting column values from a subtable.

◆ setupSelection()

void casacore::UDFMSCal::setupSelection ( const Table table,
std::vector< TENShPtr > &  operands 
)
private

Setup the baseline selection.

◆ setupStokes()

void casacore::UDFMSCal::setupStokes ( const Table table,
std::vector< TENShPtr > &  operands 
)
private

Setup the Stokes conversion.

◆ setupWvls()

void casacore::UDFMSCal::setupWvls ( const Table table,
std::vector< TENShPtr > &  operands,
uInt  nargMax 
)
private

Setup getting the wavelength information.

◆ toWvls()

Array<Double> casacore::UDFMSCal::toWvls ( const TableExprId )
private

Convert the UVW coordinates to wavelengths for the full spectrum.

Member Data Documentation

◆ itsArg

Int casacore::UDFMSCal::itsArg
private

Definition at line 245 of file UDFMSCal.h.

◆ itsDataNode

TableExprNode casacore::UDFMSCal::itsDataNode
private

Definition at line 241 of file UDFMSCal.h.

◆ itsDDIds

Vector<Int> casacore::UDFMSCal::itsDDIds
private

Definition at line 257 of file UDFMSCal.h.

◆ itsEngine

MSCalEngine casacore::UDFMSCal::itsEngine
private

Definition at line 239 of file UDFMSCal.h.

◆ itsFuncName

String casacore::UDFMSCal::itsFuncName
private

Definition at line 249 of file UDFMSCal.h.

◆ itsIdColName

String casacore::UDFMSCal::itsIdColName
private

Definition at line 251 of file UDFMSCal.h.

◆ itsIdNode

TableExprNode casacore::UDFMSCal::itsIdNode
private

Definition at line 242 of file UDFMSCal.h.

◆ itsStokesConv

StokesConverter casacore::UDFMSCal::itsStokesConv
private

Definition at line 240 of file UDFMSCal.h.

◆ itsSubColName

String casacore::UDFMSCal::itsSubColName
private

Definition at line 252 of file UDFMSCal.h.

◆ itsSubTabName

String casacore::UDFMSCal::itsSubTabName
private

Definition at line 250 of file UDFMSCal.h.

◆ itsTmpUvwWvl

Array<Double> casacore::UDFMSCal::itsTmpUvwWvl
private

Definition at line 256 of file UDFMSCal.h.

◆ itsTmpVector

Vector<Double> casacore::UDFMSCal::itsTmpVector
private

Definition at line 255 of file UDFMSCal.h.

◆ itsType

ColType casacore::UDFMSCal::itsType
private

Definition at line 244 of file UDFMSCal.h.

◆ itsUvwCol

ArrayColumn<Double> casacore::UDFMSCal::itsUvwCol
private

Definition at line 243 of file UDFMSCal.h.

◆ itsWavel

vector<Double> casacore::UDFMSCal::itsWavel
private

Definition at line 258 of file UDFMSCal.h.

◆ itsWavels

vector<Vector<Double> > casacore::UDFMSCal::itsWavels
private

Definition at line 259 of file UDFMSCal.h.


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