casacore
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::MSAntennaParse Class Reference

More...

#include <MSAntennaParse.h>

Public Types

enum  BaselineListType {
  AutoCorrOnly ,
  AutoCorrAlso ,
  CrossOnly
}
 Define the operator types (&&&, &&, and &). More...
 
enum  ComplexityLevels {
  RESET ,
  ANTREGEX ,
  ANTLIST ,
  STATIONREGEX ,
  STATIONLIST ,
  ANTATSTATIONLIST ,
  BASELINELIST ,
  HIGHESTLEVEL
}
 

Public Member Functions

 MSAntennaParse ()
 Default constructor. More...
 
 MSAntennaParse (const MeasurementSet *ms)
 Associate the ms. More...
 
 MSAntennaParse (const MSAntenna &antSubTable, const TableExprNode &ant1AsTEN, const TableExprNode &ant2AsTEN)
 
 ~MSAntennaParse ()
 
const TableExprNodeselectAntennaIds (const Vector< Int > &antennaIds, BaselineListType baselineType=CrossOnly, Bool negate=False)
 Add the given antennae selection. More...
 
const TableExprNodeselectAntennaIds (const Vector< Int > &antennaIds1, const Vector< Int > &antennaIds2, BaselineListType baselineType=CrossOnly, Bool negate=False)
 Add the given baseline selection. More...
 
const TableExprNodeselectNameOrStation (const Vector< String > &antenna, BaselineListType baselineType=CrossOnly, Bool negate=False)
 Select by name or station number. More...
 
const TableExprNodeselectNameOrStation (const Vector< String > &antenna1, const Vector< String > &antenna2, BaselineListType baselineType=CrossOnly, Bool negate=False)
 
const TableExprNodeselectNameOrStation (const String &antenna1, const String &antenna2, BaselineListType baselineType=CrossOnly, Bool negate=False)
 
const TableExprNodeselectBLRegex (const std::vector< String > &lengths, Bool negate=False)
 Selection on baseline regex. More...
 
const TableExprNodeselectLength (const std::vector< double > &lengths, Bool negate=False)
 Selection on baseline length. More...
 
TableExprNode node () const
 Get a pointer to the table expression node object. More...
 
const Vector< Int > & selectedAnt1 () const
 
const Vector< Int > & selectedAnt2 () const
 
const Matrix< Int > & selectedBaselines () const
 
void setComplexity (const ComplexityLevels &level=RESET)
 
std::bitset< HIGHESTLEVELgetComplexity ()
 
MSAntennasubTable ()
 
- Public Member Functions inherited from casacore::MSParse
 MSParse ()
 Default constructor for List container class. More...
 
 MSParse (const MSParse &)
 Copy constructor (copy semantics). More...
 
 ~MSParse ()
 
MSParseoperator= (const MSParse &)
 Assignment (copy semantics). More...
 
 MSParse (const MeasurementSet *ms, const String &shorthand)
 Associate the ms and the shorthand. More...
 
 MSParse (const MSSelectableTable *ms, const String &shorthand)
 Associate the ms and the shorthand. More...
 
Bool test (const String &shortHand) const
 Test if shorthand matches. More...
 
Stringshorthand ()
 Get the shorthand. More...
 
MeasurementSetms ()
 Get ms object. More...
 
MSSelectableTablemsInterface ()
 Get ms object. More...
 
void setMS (MeasurementSet *ms)
 
void setMSInterface (MSSelectableTable *msI)
 
void addCondition (TableExprNode &target, TableExprNode &source)
 

Static Public Member Functions

static double getUnitFactor (const char *unit)
 Get the factor to convert the given unit to m. More...
 
static void cleanupErrorHandler ()
 

Public Attributes

std::bitset< HIGHESTLEVELcomplexity
 

Static Public Attributes

static MSAntennaParsethisMSAParser
 
static CountedPtr< MSSelectionErrorHandlerthisMSAErrorHandler
 
- Static Public Attributes inherited from casacore::MSParse
static MeasurementSetms_p
 
static MSSelectableTablemsInterface_p
 

Private Member Functions

const TableExprNodemakeBLNode (const Matrix< Bool > &match, Bool negate)
 
const TableExprNodesetTEN (TableExprNode &condition, BaselineListType baselineType=CrossOnly, Bool negate=False)
 
Matrix< double > getBaselineLengths ()
 
void makeBaselineList (const Vector< Int > &a1, const Vector< Int > &a2, Matrix< Int > &b, BaselineListType baselineType=CrossOnly, Bool negate=False)
 
void makeAntennaList (Vector< Int > &antList, const Vector< Int > &thisList, Bool negate=False)
 
Bool addBaseline (const Matrix< Int > &baselist, const Int ant1, const Int ant2, BaselineListType baselineType=CrossOnly)
 

Private Attributes

TableExprNode node_p
 
const String colName1
 
const String colName2
 
Vector< Intant1List
 
Vector< Intant2List
 
Matrix< IntbaselineList
 
MSAntenna msSubTable_p
 

Static Private Attributes

static TableExprNode column1AsTEN_p
 
static TableExprNode column2AsTEN_p
 

Detailed Description

Class to hold values from antenna grammar parser

Intended use:

Internal

Etymology

MSAntennaParse is the class used to parse a antenna command.

Synopsis

MSAntennaParse is used by the parser of antenna sub-expression statements. The parser is written in Bison and Flex in files MSAntennaGram.y and.l. The statements in there use the routines in this file to act upon a reduced rule. Since multiple tables can be given (with a shorthand), the table names are stored in a list. The variable names can be qualified by the table name and will be looked up in the appropriate table.

The class MSAntennaParse only contains information about a table used in the table command. Global variables (like a list and a vector) are used in MSAntennaParse.cc to hold further information.

Global functions are used to operate on the information. The main function is the global function msAntennaCommand. It executes the given STaQL command and returns the resulting ms. This is, in fact, the only function to be used by a user.

Motivation

It is necessary to be able to give a ms command in ASCII. This can be used in a CLI or in the table browser to get a subset of a table or to sort a table.

Definition at line 88 of file MSAntennaParse.h.

Member Enumeration Documentation

◆ BaselineListType

Define the operator types (&&&, &&, and &).

Enumerator
AutoCorrOnly 
AutoCorrAlso 
CrossOnly 

Definition at line 93 of file MSAntennaParse.h.

◆ ComplexityLevels

Enumerator
RESET 
ANTREGEX 
ANTLIST 
STATIONREGEX 
STATIONLIST 
ANTATSTATIONLIST 
BASELINELIST 
HIGHESTLEVEL 

Definition at line 94 of file MSAntennaParse.h.

Constructor & Destructor Documentation

◆ MSAntennaParse() [1/3]

casacore::MSAntennaParse::MSAntennaParse ( )

Default constructor.

◆ MSAntennaParse() [2/3]

casacore::MSAntennaParse::MSAntennaParse ( const MeasurementSet ms)

Associate the ms.

◆ MSAntennaParse() [3/3]

casacore::MSAntennaParse::MSAntennaParse ( const MSAntenna antSubTable,
const TableExprNode ant1AsTEN,
const TableExprNode ant2AsTEN 
)

◆ ~MSAntennaParse()

casacore::MSAntennaParse::~MSAntennaParse ( )
inline

Definition at line 105 of file MSAntennaParse.h.

References column1AsTEN_p, and column2AsTEN_p.

Member Function Documentation

◆ addBaseline()

Bool casacore::MSAntennaParse::addBaseline ( const Matrix< Int > &  baselist,
const Int  ant1,
const Int  ant2,
BaselineListType  baselineType = CrossOnly 
)
private

◆ cleanupErrorHandler()

static void casacore::MSAntennaParse::cleanupErrorHandler ( )
inlinestatic

Definition at line 177 of file MSAntennaParse.h.

References thisMSAErrorHandler.

◆ getBaselineLengths()

Matrix<double> casacore::MSAntennaParse::getBaselineLengths ( )
private

◆ getComplexity()

std::bitset<HIGHESTLEVEL> casacore::MSAntennaParse::getComplexity ( )
inline

Definition at line 155 of file MSAntennaParse.h.

References complexity.

◆ getUnitFactor()

static double casacore::MSAntennaParse::getUnitFactor ( const char *  unit)
static

Get the factor to convert the given unit to m.

◆ makeAntennaList()

void casacore::MSAntennaParse::makeAntennaList ( Vector< Int > &  antList,
const Vector< Int > &  thisList,
Bool  negate = False 
)
private

◆ makeBaselineList()

void casacore::MSAntennaParse::makeBaselineList ( const Vector< Int > &  a1,
const Vector< Int > &  a2,
Matrix< Int > &  b,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)
private

◆ makeBLNode()

const TableExprNode* casacore::MSAntennaParse::makeBLNode ( const Matrix< Bool > &  match,
Bool  negate 
)
private

◆ node()

TableExprNode casacore::MSAntennaParse::node ( ) const
inline

Get a pointer to the table expression node object.

Definition at line 141 of file MSAntennaParse.h.

References node_p.

◆ selectAntennaIds() [1/2]

const TableExprNode* casacore::MSAntennaParse::selectAntennaIds ( const Vector< Int > &  antennaIds,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)

Add the given antennae selection.

◆ selectAntennaIds() [2/2]

const TableExprNode* casacore::MSAntennaParse::selectAntennaIds ( const Vector< Int > &  antennaIds1,
const Vector< Int > &  antennaIds2,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)

Add the given baseline selection.

◆ selectBLRegex()

const TableExprNode* casacore::MSAntennaParse::selectBLRegex ( const std::vector< String > &  lengths,
Bool  negate = False 
)

Selection on baseline regex.

◆ selectedAnt1()

const Vector<Int>& casacore::MSAntennaParse::selectedAnt1 ( ) const
inline

Definition at line 143 of file MSAntennaParse.h.

References ant1List.

◆ selectedAnt2()

const Vector<Int>& casacore::MSAntennaParse::selectedAnt2 ( ) const
inline

Definition at line 145 of file MSAntennaParse.h.

References ant2List.

◆ selectedBaselines()

const Matrix<Int>& casacore::MSAntennaParse::selectedBaselines ( ) const
inline

Definition at line 147 of file MSAntennaParse.h.

References baselineList.

◆ selectLength()

const TableExprNode* casacore::MSAntennaParse::selectLength ( const std::vector< double > &  lengths,
Bool  negate = False 
)

Selection on baseline length.

◆ selectNameOrStation() [1/3]

const TableExprNode* casacore::MSAntennaParse::selectNameOrStation ( const String antenna1,
const String antenna2,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)

◆ selectNameOrStation() [2/3]

const TableExprNode* casacore::MSAntennaParse::selectNameOrStation ( const Vector< String > &  antenna,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)

Select by name or station number.

◆ selectNameOrStation() [3/3]

const TableExprNode* casacore::MSAntennaParse::selectNameOrStation ( const Vector< String > &  antenna1,
const Vector< String > &  antenna2,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)

◆ setComplexity()

void casacore::MSAntennaParse::setComplexity ( const ComplexityLevels level = RESET)
inline

Definition at line 153 of file MSAntennaParse.h.

References complexity, RESET, and casacore::True.

◆ setTEN()

const TableExprNode* casacore::MSAntennaParse::setTEN ( TableExprNode condition,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)
private

◆ subTable()

MSAntenna& casacore::MSAntennaParse::subTable ( )
inline

Definition at line 156 of file MSAntennaParse.h.

References msSubTable_p.

Member Data Documentation

◆ ant1List

Vector<Int> casacore::MSAntennaParse::ant1List
private

Definition at line 182 of file MSAntennaParse.h.

Referenced by selectedAnt1().

◆ ant2List

Vector<Int> casacore::MSAntennaParse::ant2List
private

Definition at line 182 of file MSAntennaParse.h.

Referenced by selectedAnt2().

◆ baselineList

Matrix<Int> casacore::MSAntennaParse::baselineList
private

Definition at line 183 of file MSAntennaParse.h.

Referenced by selectedBaselines().

◆ colName1

const String casacore::MSAntennaParse::colName1
private

Definition at line 181 of file MSAntennaParse.h.

◆ colName2

const String casacore::MSAntennaParse::colName2
private

Definition at line 181 of file MSAntennaParse.h.

◆ column1AsTEN_p

TableExprNode casacore::MSAntennaParse::column1AsTEN_p
staticprivate

Definition at line 185 of file MSAntennaParse.h.

Referenced by ~MSAntennaParse().

◆ column2AsTEN_p

TableExprNode casacore::MSAntennaParse::column2AsTEN_p
staticprivate

Definition at line 185 of file MSAntennaParse.h.

Referenced by ~MSAntennaParse().

◆ complexity

std::bitset<HIGHESTLEVEL> casacore::MSAntennaParse::complexity

Definition at line 178 of file MSAntennaParse.h.

Referenced by getComplexity(), and setComplexity().

◆ msSubTable_p

MSAntenna casacore::MSAntennaParse::msSubTable_p
private

Definition at line 184 of file MSAntennaParse.h.

Referenced by subTable().

◆ node_p

TableExprNode casacore::MSAntennaParse::node_p
private

Definition at line 180 of file MSAntennaParse.h.

Referenced by node().

◆ thisMSAErrorHandler

CountedPtr<MSSelectionErrorHandler> casacore::MSAntennaParse::thisMSAErrorHandler
static

Definition at line 176 of file MSAntennaParse.h.

Referenced by cleanupErrorHandler().

◆ thisMSAParser

MSAntennaParse* casacore::MSAntennaParse::thisMSAParser
static

Definition at line 175 of file MSAntennaParse.h.


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