casa
5.7.0-16
|
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... | |
CTSelection & | operator= (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::Int > | getAntenna1List (const casacore::MeasurementSet *ms=NULL) |
Accessors for items selected: More... | |
casacore::Vector< casacore::Int > | getAntenna2List (const casacore::MeasurementSet *ms=NULL) |
Accessor for the list of antenna-2 of the selected baselines. More... | |
casacore::Vector< casacore::Int > | getFieldList (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::Int > | getSpwList (const casacore::MeasurementSet *ms=NULL) |
Accessor for the list of the selected Spectral Window IDs. More... | |
casacore::Vector< casacore::Int > | getObservationList (const casacore::MeasurementSet *ms=NULL) |
Accessor for the list of the selected Observation IDs. More... | |
casacore::Vector< casacore::Int > | getScanList (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::Int > | getRefAntIds (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::MSSelection * | msSelection_p |
CTSelection: Class to represent a selection on a CASA CalTable.
Public interface
From "CalTable" and "selection".
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.
Definition at line 91 of file CTSelection.h.
casa::CTSelection::CTSelection | ( | ) |
Default null constructor, and destructor.
|
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().
taqlExpr | const String& uvDistExpr="", // not supported |
scanExpr | const String& polnExpr="",, // not supported |
stateExpr | const 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.
|
inline |
clear selections
Definition at line 135 of file CTSelection.h.
References casacore::MSSelection::clear(), msSelection_p, and casa::type().
|
private |
Resets msSelection_p expressions for antenna selection: use taqlExpr to select on ANTENNA1 only for antenna selection, use antennaExpr for baseline selection.
|
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.
|
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.
|
inline |
Accessor for the list of selected field IDs.
Definition at line 178 of file CTSelection.h.
References casacore::MSSelection::getFieldList(), and msSelection_p.
|
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.
|
private |
make baseline strings for ref ant with all ref ants
|
private |
Reference antenna: get reference antenna ids from cal table ANTENNA2 column.
|
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.
|
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.
|
inline |
Definition at line 132 of file CTSelection.h.
References casacore::MSSelection::getTEN(), and msSelection_p.
|
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.
|
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.
taqlExpr | const String& uvDistExpr = "", // not supported |
scanExpr | const String& polnExpr = "", // not supported |
stateExpr | const String& arrayExpr = "", // not supported |
|
inline |
Definition at line 155 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setAntennaExpr().
|
private |
append baseline selection and set taql selection
|
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().
|
inline |
Definition at line 152 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setObservationExpr().
|
inline |
Definition at line 146 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setScanExpr().
|
inline |
Definition at line 144 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setSpwExpr().
|
inline |
Definition at line 150 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setStateExpr().
|
inline |
Definition at line 157 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setTaQLExpr().
|
inline |
Definition at line 148 of file CTSelection.h.
References msSelection_p, and casacore::MSSelection::setTimeExpr().
casacore::TableExprNode casa::CTSelection::toTableExprNode | ( | casacore::MSSelectableTable * | msLike | ) |
|
private |
Antenna ID 0: check if zero is selected (else it is negated but there is no -0)
|
private |
Definition at line 264 of file CTSelection.h.
Referenced by clear(), getAntenna1List(), getAntenna2List(), getFieldList(), getObservationList(), getScanList(), getSpwList(), getTEN(), getTimeList(), setAntennaExpr(), setFieldExpr(), setObservationExpr(), setScanExpr(), setSpwExpr(), setStateExpr(), setTaQLExpr(), and setTimeExpr().