MSTimeParse.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_MSTIMEPARSE_H
00029 #define MS_MSTIMEPARSE_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/ms/MSSel/MSParse.h>
00034 #include <casacore/ms/MSSel/MSSelectableMainColumn.h>
00035 #include <casacore/measures/Measures/MEpoch.h>
00036 #include <casacore/ms/MSSel/MSTimeDefinitions.h>
00037 #include <casacore/casa/Containers/Block.h>
00038 #include <casacore/casa/Arrays/Matrix.h>
00039
00040 namespace casacore {
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
00089
00090 class MSTimeParse : public MSParse
00091 {
00092
00093 public:
00094
00095 MSTimeParse ();
00096
00097
00098 MSTimeParse (const MeasurementSet* ms,const TableExprNode& otherTens,const Bool honourRowFlags=True);
00099 MSTimeParse (const MeasurementSet* ms,const TableExprNode& colAsTEN,
00100 MSSelectableMainColumn& msMainColInterface,
00101 const TableExprNode& otherTEN,
00102 const Bool honourRowFlags=True);
00103 ~MSTimeParse() {columnAsTEN_p=TableExprNode();}
00104
00105
00106
00107
00108
00109
00110
00111 const TableExprNode *selectTime(const MEpoch& time,
00112 bool daytime = false);
00113 const TableExprNode *selectTimeGT(const MEpoch& lowboundTime,
00114 bool daytime = false);
00115 const TableExprNode *selectTimeLT(const MEpoch& upboundTime,
00116 bool daytime = false);
00117 const TableExprNode *selectTimeRange(const MEpoch& lowboundTime,
00118 const MEpoch& upboundTime,
00119 bool daytime = false,
00120 Float edgeWidth=-1.0);
00121 Matrix<Double> selectedTimes() {return timeList;}
00122 const TableExprNode *addCondition(TableExprNode& condition);
00123
00124
00125
00126
00127
00128
00129
00130 static void setDefaults(TimeFields& tf, Bool dataOrigin=True);
00131 void getDefaults();
00132 static void copyDefaults(TimeFields& target, TimeFields& source);
00133 static const MEpoch *yearTimeConvert(Int year=-1, Int month=-1, Int day=-1,
00134 Int hour = -1, Int minute = -1,
00135 Int second = -1, Int millisec = -1);
00136 static const MEpoch *yearTimeConvert(const TimeFields& tf);
00137
00138
00139 static const TableExprNode* node();
00140
00141 Int year0() {return defaultYear;}
00142 Int month0() {return defaultMonth;}
00143 Int day0() {return defaultDay;}
00144 Int hour0() {return defaultHour;}
00145 Int minute0() {return defaultMinute;}
00146 Int second0() {return defaultSeconds;}
00147 Int fractionalsec0() {return defaultFractionalSec;}
00148 Double defaultInteg() {return defaultExposure;}
00149
00150 static void validate(const TimeFields& tf);
00151 static void reset(){timeList.resize(2,0);}
00152 static void cleanup() {if (node_p) delete node_p;node_p=0x0;}
00153
00154 static TableExprNode* node_p;
00155
00156
00157 static TableExprNode *otherTens_p;
00158 static Bool defaultTimeComputed;
00159 MVTime firstRowTime;
00160 static MeasurementSet *ms_p;
00161 static Double toTAIInSec(const MEpoch& time);
00162 static MEpoch* yeartime;
00163 static MEpoch* daytime;
00164 Int defaultYear, defaultMonth, defaultDay,
00165 defaultHour, defaultMinute, defaultSeconds, defaultFractionalSec;
00166 Double defaultExposure;
00167 const String colName;
00168 Bool honourRowFlags_p;
00169 static Matrix<Double> timeList;
00170 void accumulateTimeList(const Double t0, const Double t1);
00171 static MSTimeParse *thisMSTParser;
00172 static TableExprNode columnAsTEN_p;
00173 static MSSelectableMainColumn *mainColumn_p;
00174 };
00175
00176 }
00177
00178 #endif