casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::CTSelection Class Reference

CTSelection: Class to represent a selection on a CASA CalTable. More...

#include <CTSelection.h>

Public Member Functions

 CTSelection ()
 Default null constructor, and destructor. More...
 
virtual ~CTSelection ()
 
 CTSelection (const NewCalTable &ct, const casacore::MSSelection::MSSMode &mode=casacore::MSSelection::PARSE_NOW, const casacore::String &timeExpr="", const casacore::String &antennaExpr="", const casacore::String &fieldExpr="", const casacore::String &spwExpr="", const casacore::String &taqlExpr="", const casacore::String &scanExpr="", const casacore::String &stateExpr="", const casacore::String &observationExpr="")
 Construct using a NewCalTable and the various selection expressions to be applied to the given CT. More...
 
 CTSelection (const casacore::Record &selectionItem)
 Construct from a record representing a selection item at the CLI or user interface level. More...
 
 CTSelection (const CTSelection &other)
 Copy constructor. More...
 
CTSelectionoperator= (const CTSelection &other)
 Assignment operator. More...
 
casacore::TableExprNode toTableExprNode (casacore::MSSelectableTable *msLike)
 
casacore::TableExprNode getTEN ()
 
void clear (const casacore::MSSelection::MSExprType type=casacore::MSSelection::NO_EXPR)
 clear selections More...
 
casacore::Bool setFieldExpr (const casacore::String &fieldExpr)
 Expression setters. More...
 
casacore::Bool setSpwExpr (const casacore::String &spwExpr)
 
casacore::Bool setScanExpr (const casacore::String &scanExpr)
 
casacore::Bool setTimeExpr (const casacore::String &timeExpr)
 
casacore::Bool setStateExpr (const casacore::String &stateExpr)
 
casacore::Bool setObservationExpr (const casacore::String &observationExpr)
 
casacore::Bool setAntennaExpr (const casacore::String &antennaExpr)
 
casacore::Bool setTaQLExpr (const casacore::String &taqlExpr)
 
casacore::Vector< casacore::IntgetAntenna1List (const casacore::MeasurementSet *ms=NULL)
 Accessors for items selected: More...
 
casacore::Vector< casacore::IntgetAntenna2List (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of antenna-2 of the selected baselines. More...
 
casacore::Vector< casacore::IntgetFieldList (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of selected field IDs. More...
 
casacore::Matrix
< casacore::Double
getTimeList (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of the specified time range(s) as the start and end MJD values. More...
 
casacore::Vector< casacore::IntgetSpwList (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of the selected Spectral Window IDs. More...
 
casacore::Vector< casacore::IntgetObservationList (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of the selected Observation IDs. More...
 
casacore::Vector< casacore::IntgetScanList (const casacore::MeasurementSet *ms=NULL)
 Accessor for the list of the selected Scan IDs. More...
 
void reset (casacore::MSSelectableTable &msLike, const casacore::MSSelection::MSSMode &mode=casacore::MSSelection::PARSE_NOW, const casacore::String &timeExpr="", const casacore::String &antennaExpr="", const casacore::String &fieldExpr="", const casacore::String &spwExpr="", const casacore::String &taqlExpr="", const casacore::String &scanExpr="", const casacore::String &stateExpr="", const casacore::String &observationExpr="")
 
// casacore::Matrix<casacore::Int> getChanList(

const casacore::MeasurementSet* ms=NULL, const casacore::Int defaultStep=1, const casacore::Bool sorted=false); { return msSelection_p->getChanList(ms, defaultStep, sorted); } More...

 

Private Member Functions

void doCalAntennaSel (const casacore::String &antennaExpr, casacore::MSSelectableTable *msLike)
 Resets msSelection_p expressions for antenna selection: use taqlExpr to select on ANTENNA1 only for antenna selection, use antennaExpr for baseline selection. More...
 
void setAntennaSelections (casacore::String antsel, casacore::MSSelectableTable *msLike)
 append baseline selection and set taql selection More...
 
casacore::Vector< casacore::IntgetRefAntIds (casacore::MSSelectableTable *msLike)
 Reference antenna: get reference antenna ids from cal table ANTENNA2 column. More...
 
bool isRefAntenna (casacore::Int antennaId, casacore::Vector< casacore::Int > refantIds)
 check if antennaId is a reference antenna More...
 
casacore::String getRefAntBaselines (casacore::Int antId, casacore::Vector< casacore::Int > refantIds, casacore::String neg)
 make baseline strings for ref ant with all ref ants More...
 
bool zeroIsSelected (casacore::String antennaExpr, casacore::MSSelectableTable *msLike)
 Antenna ID 0: check if zero is selected (else it is negated but there is no -0) More...
 

Private Attributes

casacore::MSSelectionmsSelection_p
 

Detailed Description

CTSelection: Class to represent a selection on a CASA CalTable.

Intended use:

Public interface

Prerequisite

Etymology

From "CalTable" and "selection".

Synopsis

The CTSelection class represents a selection on a CASA CalTable (CT).

The purpose of this class is to provides a simple expression based selection mechanism to both the end-user and developer wishing to perform query operations over a measurement set. This class is a specialization of the CASACORE casacore::MSSelection class in order to override the antenna selection to select ANTENNA1 only instead of baselines, then using MSSelection as usual with the revised antennaExpr and taqlExpr.

For a complete list of the STaQL interface refer to the casacore::MeasurementSet Selection Syntax document at: Data Selection

The sub-expressions are interpreted in the order which they were set. The order however in not important - any dependency on the order in which the expressions are evaluated is handled internally. The result of parsing the expressions is casacore::TableExprNode (TEN). All TENs from sub-expressions are finally ANDed and the resultant TEN is used to select the rows of the NewCalTable.

Example

Motivation

Definition at line 91 of file CTSelection.h.

Constructor & Destructor Documentation

casa::CTSelection::CTSelection ( )

Default null constructor, and destructor.

virtual casa::CTSelection::~CTSelection ( )
virtual
casa::CTSelection::CTSelection ( const NewCalTable ct,
const casacore::MSSelection::MSSMode mode = casacore::MSSelection::PARSE_NOW,
const casacore::String timeExpr = "",
const casacore::String antennaExpr = "",
const casacore::String fieldExpr = "",
const casacore::String spwExpr = "",
const casacore::String taqlExpr = "",
const casacore::String scanExpr = "",
const casacore::String stateExpr = "",
const casacore::String observationExpr = "" 
)

Construct using a NewCalTable and the various selection expressions to be applied to the given CT.

By default, the expressions will be parsed immediately. With mode=PARSE_LATE, the parsing will be done with a call to toTableExprNode().

Parameters
taqlExprconst String& uvDistExpr="", // not supported
scanExprconst String& polnExpr="",, // not supported
stateExprconst String& arrayExpr="",i // not supported
casa::CTSelection::CTSelection ( const casacore::Record selectionItem)

Construct from a record representing a selection item at the CLI or user interface level.

This is functionally same as the constructor above with mode=PARSE_LATE.

casa::CTSelection::CTSelection ( const CTSelection other)

Copy constructor.

Member Function Documentation

void casa::CTSelection::clear ( const casacore::MSSelection::MSExprType  type = casacore::MSSelection::NO_EXPR)
inline

clear selections

Definition at line 135 of file CTSelection.h.

References casacore::MSSelection::clear(), msSelection_p, and casa::type().

void casa::CTSelection::doCalAntennaSel ( const casacore::String antennaExpr,
casacore::MSSelectableTable msLike 
)
private

Resets msSelection_p expressions for antenna selection: use taqlExpr to select on ANTENNA1 only for antenna selection, use antennaExpr for baseline selection.

casacore::Vector<casacore::Int> casa::CTSelection::getAntenna1List ( const casacore::MeasurementSet ms = NULL)
inline

Accessors for items selected:

Accessor for the list of antenna-1 selected. Antennas affected by the baseline negation operator have the antenna IDs multiplied by -1. TBD: does this work with taql?

Definition at line 166 of file CTSelection.h.

References casacore::MSSelection::getAntenna1List(), and msSelection_p.

casacore::Vector<casacore::Int> casa::CTSelection::getAntenna2List ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of antenna-2 of the selected baselines.

Antennas affected by the baseline negation operator have the antenna IDs multiplied by -1.

Definition at line 173 of file CTSelection.h.

References casacore::MSSelection::getAntenna2List(), and msSelection_p.

casacore::Vector<casacore::Int> casa::CTSelection::getFieldList ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of selected field IDs.

Definition at line 178 of file CTSelection.h.

References casacore::MSSelection::getFieldList(), and msSelection_p.

casacore::Vector<casacore::Int> casa::CTSelection::getObservationList ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of the selected Observation IDs.

Definition at line 195 of file CTSelection.h.

References casacore::MSSelection::getObservationList(), and msSelection_p.

casacore::String casa::CTSelection::getRefAntBaselines ( casacore::Int  antId,
casacore::Vector< casacore::Int refantIds,
casacore::String  neg 
)
private

make baseline strings for ref ant with all ref ants

casacore::Vector<casacore::Int> casa::CTSelection::getRefAntIds ( casacore::MSSelectableTable msLike)
private

Reference antenna: get reference antenna ids from cal table ANTENNA2 column.

casacore::Vector<casacore::Int> casa::CTSelection::getScanList ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of the selected Scan IDs.

Definition at line 200 of file CTSelection.h.

References casacore::MSSelection::getScanList(), and msSelection_p.

casacore::Vector<casacore::Int> casa::CTSelection::getSpwList ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of the selected Spectral Window IDs.

Definition at line 190 of file CTSelection.h.

References casacore::MSSelection::getSpwList(), and msSelection_p.

casacore::TableExprNode casa::CTSelection::getTEN ( )
inline

Definition at line 132 of file CTSelection.h.

References casacore::MSSelection::getTEN(), and msSelection_p.

casacore::Matrix<casacore::Double> casa::CTSelection::getTimeList ( const casacore::MeasurementSet ms = NULL)
inline

Accessor for the list of the specified time range(s) as the start and end MJD values.

The time ranges are stored as columns. Change 5/21/17: returns [startTime, stopTime, dT] CAS-10142

Definition at line 185 of file CTSelection.h.

References casacore::MSSelection::getTimeList(), and msSelection_p.

bool casa::CTSelection::isRefAntenna ( casacore::Int  antennaId,
casacore::Vector< casacore::Int refantIds 
)
private

check if antennaId is a reference antenna

CTSelection& casa::CTSelection::operator= ( const CTSelection other)

Assignment operator.

void casa::CTSelection::reset ( casacore::MSSelectableTable msLike,
const casacore::MSSelection::MSSMode mode = casacore::MSSelection::PARSE_NOW,
const casacore::String timeExpr = "",
const casacore::String antennaExpr = "",
const casacore::String fieldExpr = "",
const casacore::String spwExpr = "",
const casacore::String taqlExpr = "",
const casacore::String scanExpr = "",
const casacore::String stateExpr = "",
const casacore::String observationExpr = "" 
)

// casacore::Matrix<casacore::Int> getChanList(

const casacore::MeasurementSet* ms=NULL, const casacore::Int defaultStep=1, const casacore::Bool sorted=false); { return msSelection_p->getChanList(ms, defaultStep, sorted); }

// // Same as getChanList, except that the channels and steps are in Hz. // casacore::Matrix<casacore::Double> getChanFreqList( const casacore::MeasurementSet* ms=NULL, const casacore::Bool sorted=false); { return msSelection_p->getChanFreqList(ms, sorted); }

This version of reset() works with generic MSSelectableTable object. Accessing the services of the CTSelection module via this interface is recommended over the version of reset() that uses MeasurementSet.

Parameters
taqlExprconst String& uvDistExpr = "", // not supported
scanExprconst String& polnExpr = "", // not supported
stateExprconst String& arrayExpr = "", // not supported
casacore::Bool casa::CTSelection::setAntennaExpr ( const casacore::String antennaExpr)
inline

Definition at line 155 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setAntennaExpr().

void casa::CTSelection::setAntennaSelections ( casacore::String  antsel,
casacore::MSSelectableTable msLike 
)
private

append baseline selection and set taql selection

casacore::Bool casa::CTSelection::setFieldExpr ( const casacore::String fieldExpr)
inline

Expression setters.

The following set*Expr() methods only set the expressions. Parsing is done with a call to toTableExprNode().

Definition at line 142 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setFieldExpr().

casacore::Bool casa::CTSelection::setObservationExpr ( const casacore::String observationExpr)
inline

Definition at line 152 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setObservationExpr().

casacore::Bool casa::CTSelection::setScanExpr ( const casacore::String scanExpr)
inline

Definition at line 146 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setScanExpr().

casacore::Bool casa::CTSelection::setSpwExpr ( const casacore::String spwExpr)
inline

Definition at line 144 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setSpwExpr().

casacore::Bool casa::CTSelection::setStateExpr ( const casacore::String stateExpr)
inline

Definition at line 150 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setStateExpr().

casacore::Bool casa::CTSelection::setTaQLExpr ( const casacore::String taqlExpr)
inline

Definition at line 157 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setTaQLExpr().

casacore::Bool casa::CTSelection::setTimeExpr ( const casacore::String timeExpr)
inline

Definition at line 148 of file CTSelection.h.

References msSelection_p, and casacore::MSSelection::setTimeExpr().

casacore::TableExprNode casa::CTSelection::toTableExprNode ( casacore::MSSelectableTable msLike)
bool casa::CTSelection::zeroIsSelected ( casacore::String  antennaExpr,
casacore::MSSelectableTable msLike 
)
private

Antenna ID 0: check if zero is selected (else it is negated but there is no -0)

Member Data Documentation

casacore::MSSelection* casa::CTSelection::msSelection_p
private

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