casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
casa::MSAntennaParse Class Reference

Class to hold values from antenna grammar parser. More...

#include <MSAntennaParse.h>

Inheritance diagram for casa::MSAntennaParse:
casa::MSParse

List of all members.

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.
 MSAntennaParse (const MeasurementSet *ms)
 Associate the ms.
 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.
const TableExprNodeselectAntennaIds (const Vector< Int > &antennaIds1, const Vector< Int > &antennaIds2, BaselineListType baselineType=CrossOnly, Bool negate=False)
 Add the given baseline selection.
const TableExprNodeselectNameOrStation (const Vector< String > &antenna, BaselineListType baselineType=CrossOnly, Bool negate=False)
 Select by name or station number.
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 TableExprNodeselectLength (const std::vector< double > &lengths, Bool negate=False)
 Selection on baseline length.
TableExprNode node () const
 Get a pointer to the table expression node object.
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 ()

Static Public Member Functions

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

Public Attributes

std::bitset< HIGHESTLEVELcomplexity

Static Public Attributes

static MSAntennaParsethisMSAParser
static MSSelectionErrorHandlerthisMSAErrorHandler

Private Member Functions

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 87 of file MSAntennaParse.h.


Member Enumeration Documentation

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

Enumerator:
AutoCorrOnly 
AutoCorrAlso 
CrossOnly 

Definition at line 92 of file MSAntennaParse.h.

Enumerator:
RESET 
ANTREGEX 
ANTLIST 
STATIONREGEX 
STATIONLIST 
ANTATSTATIONLIST 
BASELINELIST 
HIGHESTLEVEL 

Definition at line 93 of file MSAntennaParse.h.


Constructor & Destructor Documentation

Default constructor.

Associate the ms.

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

Definition at line 104 of file MSAntennaParse.h.

References column1AsTEN_p, and column2AsTEN_p.


Member Function Documentation

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

Definition at line 150 of file MSAntennaParse.h.

References complexity.

static double casa::MSAntennaParse::getUnitFactor ( const char *  unit) [static]

Get the factor to convert the given unit to m.

void casa::MSAntennaParse::makeAntennaList ( Vector< Int > &  antList,
const Vector< Int > &  thisList,
Bool  negate = False 
) [private]
void casa::MSAntennaParse::makeBaselineList ( const Vector< Int > &  a1,
const Vector< Int > &  a2,
Matrix< Int > &  b,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
) [private]

Get a pointer to the table expression node object.

Definition at line 136 of file MSAntennaParse.h.

References node_p.

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

Add the given antennae selection.

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

Add the given baseline selection.

const Vector<Int>& casa::MSAntennaParse::selectedAnt1 ( ) const [inline]

Definition at line 138 of file MSAntennaParse.h.

References ant1List.

const Vector<Int>& casa::MSAntennaParse::selectedAnt2 ( ) const [inline]

Definition at line 140 of file MSAntennaParse.h.

References ant2List.

Definition at line 142 of file MSAntennaParse.h.

References baselineList.

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

Selection on baseline length.

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

Select by name or station number.

const TableExprNode* casa::MSAntennaParse::selectNameOrStation ( const Vector< String > &  antenna1,
const Vector< String > &  antenna2,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)
const TableExprNode* casa::MSAntennaParse::selectNameOrStation ( const String antenna1,
const String antenna2,
BaselineListType  baselineType = CrossOnly,
Bool  negate = False 
)
void casa::MSAntennaParse::setComplexity ( const ComplexityLevels level = RESET) [inline]

Definition at line 148 of file MSAntennaParse.h.

References complexity, RESET, and casa::True.

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

Definition at line 151 of file MSAntennaParse.h.

References msSubTable_p.


Member Data Documentation

Definition at line 174 of file MSAntennaParse.h.

Referenced by selectedAnt1().

Definition at line 174 of file MSAntennaParse.h.

Referenced by selectedAnt2().

Definition at line 175 of file MSAntennaParse.h.

Referenced by selectedBaselines().

Definition at line 173 of file MSAntennaParse.h.

Definition at line 173 of file MSAntennaParse.h.

Definition at line 177 of file MSAntennaParse.h.

Referenced by ~MSAntennaParse().

Definition at line 177 of file MSAntennaParse.h.

Referenced by ~MSAntennaParse().

Definition at line 170 of file MSAntennaParse.h.

Referenced by getComplexity(), and setComplexity().

Definition at line 176 of file MSAntennaParse.h.

Referenced by subTable().

Definition at line 172 of file MSAntennaParse.h.

Referenced by node().

Definition at line 169 of file MSAntennaParse.h.

Definition at line 168 of file MSAntennaParse.h.


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