MSAntennaParse.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MS_MSANTENNAPARSE_H
00029 #define MS_MSANTENNAPARSE_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/ms/MSSel/MSParse.h>
00034 #include <casacore/ms/MSSel/MSSelectionErrorHandler.h>
00035 #include <casacore/casa/Arrays/Matrix.h>
00036 #include <bitset>
00037 namespace casacore {
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 class MSAntennaParse : public MSParse
00089 {
00090
00091 public:
00092
00093 enum BaselineListType {AutoCorrOnly=0, AutoCorrAlso, CrossOnly};
00094 enum ComplexityLevels {RESET=0,ANTREGEX,ANTLIST,STATIONREGEX, STATIONLIST, ANTATSTATIONLIST, BASELINELIST,HIGHESTLEVEL};
00095
00096
00097 MSAntennaParse();
00098
00099
00100 MSAntennaParse (const MeasurementSet* ms);
00101
00102 MSAntennaParse (const MSAntenna& antSubTable,
00103 const TableExprNode& ant1AsTEN, const TableExprNode& ant2AsTEN);
00104
00105 ~MSAntennaParse() {column1AsTEN_p=TableExprNode();column2AsTEN_p=TableExprNode();}
00106
00107
00108 const TableExprNode* selectAntennaIds(const Vector<Int>& antennaIds,
00109 BaselineListType baselineType=CrossOnly,
00110 Bool negate=False);
00111
00112
00113 const TableExprNode* selectAntennaIds(const Vector<Int>& antennaIds1,
00114 const Vector<Int>& antennaIds2,
00115 BaselineListType baselineType=CrossOnly,
00116 Bool negate=False);
00117
00118
00119 const TableExprNode* selectNameOrStation(const Vector<String>& antenna,
00120 BaselineListType baselineType=CrossOnly,
00121 Bool negate=False);
00122 const TableExprNode* selectNameOrStation(const Vector<String>& antenna1,
00123 const Vector<String>& antenna2,
00124 BaselineListType baselineType=CrossOnly,
00125 Bool negate=False);
00126
00127 const TableExprNode* selectNameOrStation(const String& antenna1,
00128 const String& antenna2,
00129 BaselineListType baselineType=CrossOnly,
00130 Bool negate=False);
00131
00132
00133 const TableExprNode* selectBLRegex(const std::vector<String>& lengths,
00134 Bool negate=False);
00135
00136
00137 const TableExprNode* selectLength(const std::vector<double>& lengths,
00138 Bool negate=False);
00139
00140
00141 TableExprNode node() const
00142 { return node_p; }
00143 const Vector<Int>& selectedAnt1() const
00144 { return ant1List; }
00145 const Vector<Int>& selectedAnt2() const
00146 { return ant2List; }
00147 const Matrix<Int>& selectedBaselines() const
00148 { return baselineList; }
00149
00150
00151 static double getUnitFactor (const char* unit);
00152
00153 void setComplexity(const ComplexityLevels& level=RESET)
00154 {if (level==RESET) complexity.reset(); else complexity.set(level,True);}
00155 std::bitset<HIGHESTLEVEL> getComplexity() {return complexity;}
00156 MSAntenna& subTable() {return msSubTable_p;}
00157 private:
00158 const TableExprNode* makeBLNode (const Matrix<Bool>& match,
00159 Bool negate);
00160 const TableExprNode* setTEN(TableExprNode& condition,
00161 BaselineListType baselineType=CrossOnly,
00162 Bool negate=False);
00163 Matrix<double> getBaselineLengths();
00164 void makeBaselineList(const Vector<Int>&a1, const Vector<Int>&a2, Matrix<Int>&b,
00165 BaselineListType baselineType=CrossOnly,
00166 Bool negate=False);
00167 void makeAntennaList(Vector<Int>& antList,const Vector<Int>& thisList,
00168 Bool negate=False);
00169 Bool addBaseline(const Matrix<Int>& baselist,
00170 const Int ant1, const Int ant2,
00171 BaselineListType baselineType=CrossOnly);
00172
00173
00174 public:
00175 static MSAntennaParse* thisMSAParser;
00176 static MSSelectionErrorHandler* thisMSAErrorHandler;
00177 static void cleanupErrorHandler() {if (thisMSAErrorHandler) delete thisMSAErrorHandler;thisMSAErrorHandler=0x0;}
00178 std::bitset<HIGHESTLEVEL> complexity;
00179 private:
00180 TableExprNode node_p;
00181 const String colName1, colName2;
00182 Vector<Int> ant1List, ant2List;
00183 Matrix<Int> baselineList;
00184 MSAntenna msSubTable_p;
00185 static TableExprNode column1AsTEN_p,column2AsTEN_p;
00186 };
00187
00188 }
00189
00190 #endif