Go to the documentation of this file.
29 #ifndef MS_MSSELECTION_H
30 #define MS_MSSELECTION_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicSL/String.h>
34 #include <casacore/casa/Arrays/Vector.h>
35 #include <casacore/measures/Measures/MEpoch.h>
36 #include <casacore/measures/Measures/MRadialVelocity.h>
37 #include <casacore/tables/TaQL/ExprNode.h>
38 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
39 #include <casacore/casa/Arrays/Matrix.h>
40 #include <casacore/casa/Arrays/Cube.h>
41 #include <casacore/ms/MSSel/MSSelectionError.h>
42 #include <casacore/ms/MSSel/MSSelectionErrorHandler.h>
43 #include <casacore/ms/MSSel/MSSelectableTable.h>
148 const String& timeExpr=
"",
149 const String& antennaExpr=
"",
150 const String& fieldExpr=
"",
152 const String& uvDistExpr=
"",
153 const String& taqlExpr=
"",
154 const String& polnExpr=
"",
155 const String& scanExpr=
"",
156 const String& arrayExpr=
"",
157 const String& stateExpr=
"",
158 const String& observationExpr=
"",
159 const String& feedExpr=
"");
306 const Int defaultStep=1,
432 const Int defaultChanStep=1);
479 const String& outMSName=
"");
503 const String& timeExpr =
"",
504 const String& antennaExpr =
"",
505 const String& fieldExpr =
"",
506 const String& spwExpr =
"",
507 const String& uvDistExpr =
"",
508 const String& taqlExpr =
"",
509 const String& polnExpr =
"",
510 const String& scanExpr =
"",
511 const String& arrayExpr =
"",
512 const String& stateExpr =
"",
513 const String& observationExpr =
"");
518 const String& timeExpr =
"",
519 const String& antennaExpr =
"",
520 const String& fieldExpr =
"",
521 const String& spwExpr =
"",
522 const String& uvDistExpr =
"",
523 const String& taqlExpr =
"",
524 const String& polnExpr =
"",
525 const String& scanExpr =
"",
526 const String& arrayExpr =
"",
527 const String& stateExpr =
"",
528 const String& observationExpr =
"",
529 const String& feedExpr =
"");
537 const String& timeExpr =
"",
538 const String& antennaExpr =
"",
539 const String& fieldExpr =
"",
540 const String& spwExpr =
"",
541 const String& uvDistExpr =
"",
542 const String& taqlExpr =
"",
543 const String& polnExpr =
"",
544 const String& scanExpr =
"",
545 const String& arrayExpr =
"",
546 const String& stateExpr =
"",
547 const String& observationExpr =
"");
552 const String& timeExpr =
"",
553 const String& antennaExpr =
"",
554 const String& fieldExpr =
"",
555 const String& spwExpr =
"",
556 const String& uvDistExpr =
"",
557 const String& taqlExpr =
"",
558 const String& polnExpr =
"",
559 const String& scanExpr =
"",
560 const String& arrayExpr =
"",
561 const String& stateExpr =
"",
562 const String& observationExpr =
"",
563 const String& feedExpr =
"");
Vector< Int > getDDIDList(const MeasurementSet *ms=NULL)
Accessor for the list of the selected Data Description IDs (DDID) from the polarization expression pa...
Vector< Int > getObservationList(const MeasurementSet *ms=NULL)
Accessor for the list of the selected observation IDs.
Vector< Int > getScanList(const MeasurementSet *ms=NULL)
Accessor for the list of the selected scan IDs.
MSSelection()
Default null constructor, and destructor.
void deleteErrorHandlers()
Delete error handlers (mostly the internally allocated ones).
Vector< Int > getStateObsModeList(const MeasurementSet *ms=NULL)
Accessor for the list of selected state Obs_Modes.
void setErrorHandler(const MSExprType type, MSSelectionErrorHandler *mssEH, const Bool overRide=True)
Set the error handler to be used for reporting errors while parsing the type of expression give by th...
Bool setAntennaExpr(const String &antennaExpr)
Expression setters.
Bool setFieldExpr(const String &fieldExpr)
Vector< Int > getAntenna1List(const MeasurementSet *ms=NULL)
Accessor for the list of antenna-1 of the selected baselines.
Vector< Int > getFieldList(const MeasurementSet *ms=NULL)
Accessor for the list of selected field IDs.
void fromSelectionItem(const Record &selectionItem)
Initialize from a Record representing a selection item from the user interface or CLI.
Bool setObservationExpr(const String &observationExpr)
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
TableExprNode getTEN(const MeasurementSet *ms=NULL)
Accessor for result of parsing all of the selection expressions.
Matrix< Int > getFeedPairList(const MeasurementSet *ms=NULL)
Similar to baselines for antennas.
Bool setTaQLExpr(const String &taqlExpr)
Matrix< Int > getBaselineList(const MeasurementSet *ms=NULL)
Accessor for the list of selected baselines.
Vector< Int > observationIDs_p
Bool getSelectedMS(MeasurementSet &selectedMS, const String &outMSName="")
Return the selected MS.
void resetMS(const MeasurementSet &ms)
void runErrorHandler()
Execute the handleError() method of the error-handlers.
Matrix< Double > getUVList(const MeasurementSet *ms=NULL)
Accessor for the list of the specified uv-range(s) as the start and end values in units used in the M...
void setMaxObs(const Int &n=1000)
Vector< Int > getFeed1List(const MeasurementSet *ms=NULL)
Accessor for the list of the selected feed1 IDs.
Vector< Bool > selectedUVUnits_p
const MeasurementSet * ms_p
void reset2(const MeasurementSet &ms, const MSSMode &mode=PARSE_NOW, const String &timeExpr="", const String &antennaExpr="", const String &fieldExpr="", const String &spwExpr="", const String &uvDistExpr="", const String &taqlExpr="", const String &polnExpr="", const String &scanExpr="", const String &arrayExpr="", const String &stateExpr="", const String &observationExpr="", const String &feedExpr="")
Add feedExpr; keep old signature for backwards compatibility.
void getCorrSlices(Vector< Vector< Slice > > &corrslices, const MeasurementSet *ms=NULL)
Bool setArrayExpr(const String &ArrayExpr)
std::map< Int, Vector< Vector< Int > > > selectedSetupMap_p
Vector< Int > stateObsModeIDs_p
Bool setTimeExpr(const String &timeExpr)
Vector< Int > getAntenna2List(const MeasurementSet *ms=NULL)
Accessor for the list of antenna-2 of the selected baselines.
std::map< Int, Vector< Int > > selectedPolMap_p
Bool setPolnExpr(const String &polnExpr)
Vector< Int > getFeed2List(const MeasurementSet *ms=NULL)
Accessor for the list of the selected feed2 IDs.
void setMaxScans(const Int &n=1000)
Set the maximum value acceptable for SCAN, OBSERVATION or SUB-ARRAY IDs.
std::map< Int, Vector< Int > > getPolMap(const MeasurementSet *ms=NULL)
The key in the ordered map returned by getPolMap() is the Data Description ID (DDID).
Bool definedAndSet(const Record &inpRec, const String &fieldName)
Check if record field exists and is not unset.
void reset(const MeasurementSet &ms, const MSSMode &mode=PARSE_NOW, const String &timeExpr="", const String &antennaExpr="", const String &fieldExpr="", const String &spwExpr="", const String &uvDistExpr="", const String &taqlExpr="", const String &polnExpr="", const String &scanExpr="", const String &arrayExpr="", const String &stateExpr="", const String &observationExpr="")
The MSSelection object is designed to be re-usable object.
this file contains all the compiler specific defines
Matrix< Int > getChanList(const MeasurementSet *ms=NULL, const Int defaultStep=1, const Bool sorted=False)
Accessor for the table (as a nx4 Matrix) of the selected Spectral Windows and associated ranges of se...
Vector< Int > exprOrder_p
Priority.
std::map< Int, Vector< Vector< Int > > > getCorrMap(const MeasurementSet *ms=NULL)
The key in the ordered map returned by getCorrMap() is the pol.
Bool setOrder(MSSelection::MSExprType type)
Set into the order of the selection expression.
void clear(const MSExprType type=NO_EXPR)
Clear sub-expression and reset priority.
Vector< Int > getSPWDDIDList(const MeasurementSet *ms=NULL)
Accessor for the list of the selected Data Description IDs from the SPW expression parsing.
Handle class for a table column expression tree.
Matrix< Int > baselineIDs_p
void getChanSlices(Vector< Vector< Slice > > &chanslices, const MeasurementSet *ms=NULL, const Int defaultChanStep=1)
Methods to convert the maps return by getChanList and getCorrMap to a list of Slice which can be dire...
Bool setUvDistExpr(const String &uvDistExpr)
static String nameExprStr(Vector< String > name)
Helper method for converting name vectors to expression strings.
Bool setScanExpr(const String &scanExpr)
Vector< Int > getSpwList(const MeasurementSet *ms=NULL)
Accessor for the list of the selected Spectral Window IDs.
TableExprNode toTableExprNode(const MeasurementSet *ms)
Convert to TableExprNode format (C++ interface to TaQL).
Bool setStateExpr(const String &stateExpr)
TableExprNode fullTEN_p
Convert an MS select string to TaQL const String msToTaQL(const String& msSelect) {};.
A Table intended to hold astronomical data (a set of Measurements).
void initErrorHandler(const MSExprType tye=NO_EXPR)
Initialize the error handler.
const String getExpr(const MSExprType type=NO_EXPR)
Accessor for the various selection expressions as strings.
MSSelectableTable: An interface class used by MSSelection module to access the sub-tables and main-ta...
Matrix< Double > selectedTimesList_p
Bool setFeedExpr(const String &feedExpr)
String antennaExpr_p
Selection expressions.
Matrix< Double > getChanFreqList(const MeasurementSet *ms=NULL, const Bool sorted=False)
Same as getChanList, except that the channels and steps are in Hz.
void setMaxArray(const Int &n=1000)
Vector< Int > getSubArrayList(const MeasurementSet *ms=NULL)
Accessor for the list of selected sub-array IDs.
void clearErrorHandlers()
Set all error handlers to a known state (NULL).
Vector< Int > antenna1IDs_p
String: the storage and methods of handling collections of characters.
MSSelection & operator=(const MSSelection &other)
Assignment operator.
const MeasurementSet * getMS(MSSelectableTable *msLike)
Return the pointer to the MS used internally.
Vector< Int > antenna2IDs_p
bool Bool
Define the standard types used by Casacore.
Matrix< Double > selectedUVRange_p
A hierarchical collection of named fields of various types.
Vector< Bool > getUVUnitsList(const MeasurementSet *ms=NULL)
Accessor for the list of user defined units for the uv-range(s).
static String indexExprStr(Vector< Int > index)
Helper method for converting index vectors to expression strings.
MSSelection: Class to represent a selection on an MS
Bool exprIsNull(const MSExprType type=NO_EXPR)
Matrix< Double > getTimeList(const MeasurementSet *ms=NULL)
Accessor for the list of the specified time range(s) as the start and end MJD values.
void deleteNodes()
Convey to the various parsers to delete the TENs they hold.
Bool setSpwExpr(const String &spwExpr)
Matrix< Int > feedPairIDs_p