casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::UDFMSCal Class Reference

TaQL UDFs to calculate derived MS values. More...

#include <UDFMSCal.h>

Inheritance diagram for casacore::UDFMSCal:
casacore::UDFBase

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

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.

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

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

Create object the given ColType and SelType.

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

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

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

Member Function Documentation

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Get the value.

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Reimplemented from casacore::UDFBase.

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

Get the rownr in the subtable for GetValue.

If itsArg==1 it uses indirection using itsDDIds.

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

Reimplemented from casacore::UDFBase.

static UDFBase* casacore::UDFMSCal::makeAnt1Col ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAnt1Name ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAnt2Col ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAnt2Name ( const String )
static
static UDFBase* casacore::UDFMSCal::makeArray ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAZEL ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAZEL1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeAZEL2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeBaseline ( const String )
static
static UDFBase* casacore::UDFMSCal::makeCorr ( const String )
static
static UDFBase* casacore::UDFMSCal::makeDelay ( const String )
static
static UDFBase* casacore::UDFMSCal::makeDelay1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeDelay2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeFeed ( const String )
static
static UDFBase* casacore::UDFMSCal::makeField ( const String )
static
static UDFBase* casacore::UDFMSCal::makeFieldCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeHA ( const String )
static

Function to create an object.

static UDFBase* casacore::UDFMSCal::makeHA1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeHA2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeHADEC ( const String )
static
static UDFBase* casacore::UDFMSCal::makeHADEC1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeHADEC2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeITRF ( const String )
static
static UDFBase* casacore::UDFMSCal::makeLAST ( const String )
static
static UDFBase* casacore::UDFMSCal::makeLAST1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeLAST2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeObs ( const String )
static
static UDFBase* casacore::UDFMSCal::makeObsCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makePA1 ( const String )
static
static UDFBase* casacore::UDFMSCal::makePA2 ( const String )
static
static UDFBase* casacore::UDFMSCal::makePolCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeProcCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeScan ( const String )
static
static UDFBase* casacore::UDFMSCal::makeSpw ( const String )
static
static UDFBase* casacore::UDFMSCal::makeSpwCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeState ( const String )
static
static UDFBase* casacore::UDFMSCal::makeStateCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeStokes ( const String )
static
static UDFBase* casacore::UDFMSCal::makeSubCol ( const String )
static
static UDFBase* casacore::UDFMSCal::makeTime ( const String )
static
static UDFBase* casacore::UDFMSCal::makeUVDist ( const String )
static
static UDFBase* casacore::UDFMSCal::makeUvwAPP ( const String )
static
static UDFBase* casacore::UDFMSCal::makeUvwJ2000 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeUvwWvl ( const String )
static
static UDFBase* casacore::UDFMSCal::makeUvwWvls ( const String )
static
static UDFBase* casacore::UDFMSCal::makeWvlAPP ( const String )
static
static UDFBase* casacore::UDFMSCal::makeWvlJ2000 ( const String )
static
static UDFBase* casacore::UDFMSCal::makeWvlsAPP ( const String )
static
static UDFBase* casacore::UDFMSCal::makeWvlsJ2000 ( const String )
static
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.

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

Setup the object.

Implements casacore::UDFBase.

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

Setup direction conversion if a direction is explicitly given.

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

Setup getting column values from a subtable.

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

Setup the baseline selection.

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

Setup the Stokes conversion.

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

Setup getting the wavelength information.

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

Convert the UVW coordinates to wavelengths for the full spectrum.

Member Data Documentation

Int casacore::UDFMSCal::itsArg
private

Definition at line 245 of file UDFMSCal.h.

TableExprNode casacore::UDFMSCal::itsDataNode
private

Definition at line 241 of file UDFMSCal.h.

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

Definition at line 257 of file UDFMSCal.h.

MSCalEngine casacore::UDFMSCal::itsEngine
private

Definition at line 239 of file UDFMSCal.h.

String casacore::UDFMSCal::itsFuncName
private

Definition at line 249 of file UDFMSCal.h.

String casacore::UDFMSCal::itsIdColName
private

Definition at line 251 of file UDFMSCal.h.

TableExprNode casacore::UDFMSCal::itsIdNode
private

Definition at line 242 of file UDFMSCal.h.

StokesConverter casacore::UDFMSCal::itsStokesConv
private

Definition at line 240 of file UDFMSCal.h.

String casacore::UDFMSCal::itsSubColName
private

Definition at line 252 of file UDFMSCal.h.

String casacore::UDFMSCal::itsSubTabName
private

Definition at line 250 of file UDFMSCal.h.

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

Definition at line 256 of file UDFMSCal.h.

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

Definition at line 255 of file UDFMSCal.h.

ColType casacore::UDFMSCal::itsType
private

Definition at line 244 of file UDFMSCal.h.

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

Definition at line 243 of file UDFMSCal.h.

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

Definition at line 258 of file UDFMSCal.h.

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: