casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::MSPolnParse Class Reference

More...

#include <MSPolnParse.h>

Public Member Functions

 MSPolnParse ()
 Default constructor. More...
 
 MSPolnParse (const MeasurementSet *ms)
 ~MSPolnParse() {cleanup();} More...
 
const TableExprNode selectFromIDList (const Vector< Int > &ddIDs)
 
const TableExprNode node ()
 Get table expression node object. More...
 
void reset ()
 static MSPolnParse* thisMSSParser; More...
 
void cleanup ()
 
Int theParser (const String &command)
 
std::map< Int, Vector< Int > > selectedPolnMap ()
 Vector<Int>& selectedDDIDs, Matrix<Int>& selectedSpwPolnMap);. More...
 
std::map< Int, Vector< Vector< Int > > > selectedSetupMap ()
 
Vector< IntselectedDDIDs ()
 
- 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)
 

Private Member Functions

Vector< IntgetMapToDDIDs (MSDataDescIndex &msDDNdx, MSPolarizationIndex &msPolNdx, const Vector< Int > &spwIDs, Vector< Int > &polnIDs, Vector< Int > &polIndices)
 
Vector< IntmatchPolIDsToPolTableRow (const Vector< Int > &polIds, std::map< Int, Vector< Int > > &polIndexMap, Vector< Int > &polIndices, Bool addToMap=False)
 
Vector< IntgetPolnIDs (const String &polSpec, Vector< Int > &polIndices)
 
Vector< IntgetPolnIndices (const Int &polnID, const Vector< Int > &polnIDList)
 
Vector< IntgetPolnIDsV2 (const String &polSpec, Vector< Int > &polTypes)
 These are the versions used in the code. More...
 
Vector< IntgetMapToDDIDsV2 (const String &polExpr, const Vector< Int > &spwIDs, Vector< Int > &polnIDs, Vector< Int > &polnIndices)
 
void setIDLists (const Int key, const Int ndx, Vector< Int > &val)
 

Private Attributes

TableExprNode node_p
 
Vector< IntddIDList_p
 
std::map< Int, Vector< Int > > polMap_p
 
std::map< Int, Vector< Vector< Int > > > setupMap_p
 

Additional Inherited Members

- Static Public Attributes inherited from casacore::MSParse
static MeasurementSetms_p
 
static MSSelectableTablemsInterface_p
 

Detailed Description

Class to hold values from field grammar parser

Intended use:

Internal

Etymology

MSPolnParse is the class used to parse a polarization selection command.

Synopsis

MSPolnParse is used by the parser of polarization sub-expression statements of the type [SPW:]POLN. Since this is a relatively simple expression to tokenize and parse, this parser is written without Bison or Flex. The methods of this class take an expression, and internally generate a list of the Data Description IDs that should be used to select the rows in the MS main table. The map of Polarization IDs (row numbers in the POLARIZATION sub-table) and the list of indices to be used to pick the user selected polarzation data (in the DATA columns of the MS main table) is also generated. This map is intended to be used along with the map of SPW and selected channels to apply the in-row selection (Slice on the data columns).

Motivation

It is necessary to be able to give a data selection 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 89 of file MSPolnParse.h.

Constructor & Destructor Documentation

◆ MSPolnParse() [1/2]

casacore::MSPolnParse::MSPolnParse ( )

Default constructor.

◆ MSPolnParse() [2/2]

casacore::MSPolnParse::MSPolnParse ( const MeasurementSet ms)

~MSPolnParse() {cleanup();}

Associate the ms and the shorthand.

Member Function Documentation

◆ cleanup()

void casacore::MSPolnParse::cleanup ( )
inline

Definition at line 105 of file MSPolnParse.h.

◆ getMapToDDIDs()

Vector<Int> casacore::MSPolnParse::getMapToDDIDs ( MSDataDescIndex msDDNdx,
MSPolarizationIndex msPolNdx,
const Vector< Int > &  spwIDs,
Vector< Int > &  polnIDs,
Vector< Int > &  polIndices 
)
private

◆ getMapToDDIDsV2()

Vector<Int> casacore::MSPolnParse::getMapToDDIDsV2 ( const String polExpr,
const Vector< Int > &  spwIDs,
Vector< Int > &  polnIDs,
Vector< Int > &  polnIndices 
)
private

◆ getPolnIDs()

Vector<Int> casacore::MSPolnParse::getPolnIDs ( const String polSpec,
Vector< Int > &  polIndices 
)
private

◆ getPolnIDsV2()

Vector<Int> casacore::MSPolnParse::getPolnIDsV2 ( const String polSpec,
Vector< Int > &  polTypes 
)
private

These are the versions used in the code.

◆ getPolnIndices()

Vector<Int> casacore::MSPolnParse::getPolnIndices ( const Int polnID,
const Vector< Int > &  polnIDList 
)
private

◆ matchPolIDsToPolTableRow()

Vector<Int> casacore::MSPolnParse::matchPolIDsToPolTableRow ( const Vector< Int > &  polIds,
std::map< Int, Vector< Int > > &  polIndexMap,
Vector< Int > &  polIndices,
Bool  addToMap = False 
)
private

◆ node()

const TableExprNode casacore::MSPolnParse::node ( )

Get table expression node object.

◆ reset()

void casacore::MSPolnParse::reset ( )
inline

static MSPolnParse* thisMSSParser;

Definition at line 104 of file MSPolnParse.h.

References ddIDList_p, polMap_p, and casacore::Vector< T, Alloc >::resize().

◆ selectedDDIDs()

Vector<Int> casacore::MSPolnParse::selectedDDIDs ( )
inline

Definition at line 111 of file MSPolnParse.h.

References ddIDList_p.

◆ selectedPolnMap()

std::map<Int, Vector<Int> > casacore::MSPolnParse::selectedPolnMap ( )
inline

Vector<Int>& selectedDDIDs, Matrix<Int>& selectedSpwPolnMap);.

Definition at line 109 of file MSPolnParse.h.

References polMap_p.

◆ selectedSetupMap()

std::map<Int, Vector<Vector<Int> > > casacore::MSPolnParse::selectedSetupMap ( )
inline

Definition at line 110 of file MSPolnParse.h.

References setupMap_p.

◆ selectFromIDList()

const TableExprNode casacore::MSPolnParse::selectFromIDList ( const Vector< Int > &  ddIDs)

◆ setIDLists()

void casacore::MSPolnParse::setIDLists ( const Int  key,
const Int  ndx,
Vector< Int > &  val 
)
private

◆ theParser()

Int casacore::MSPolnParse::theParser ( const String command)

Member Data Documentation

◆ ddIDList_p

Vector<Int> casacore::MSPolnParse::ddIDList_p
private

Definition at line 130 of file MSPolnParse.h.

Referenced by reset(), and selectedDDIDs().

◆ node_p

TableExprNode casacore::MSPolnParse::node_p
private

Definition at line 129 of file MSPolnParse.h.

◆ polMap_p

std::map<Int, Vector<Int> > casacore::MSPolnParse::polMap_p
private

Definition at line 131 of file MSPolnParse.h.

Referenced by reset(), and selectedPolnMap().

◆ setupMap_p

std::map<Int, Vector<Vector<Int> > > casacore::MSPolnParse::setupMap_p
private

Definition at line 132 of file MSPolnParse.h.

Referenced by selectedSetupMap().


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