MsAverager.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
00029
00030 #if !defined MSAVERAGER_H
00031 #define MSAVERAGER_H
00032
00033
00034 #include <casa/aips.h>
00035
00036 #include <tables/Tables/SetupNewTab.h>
00037
00038 #include <tables/Tables/MemoryTable.h>
00039 #include <tables/Tables/TableDesc.h>
00040 #include <tables/DataMan/StManAipsIO.h>
00041
00042 #include <ms/MeasurementSets/MSColumns.h>
00043 #include <ms/MeasurementSets/MeasurementSet.h>
00044
00045 #include <casa/Containers/List.h>
00046
00047 #include <msvis/MSVis/VisBuffer.h>
00048 #include <msvis/MSVis/VisibilityIterator.h>
00049 #include <msvis/MSVis/VisSet.h>
00050
00051 #include <msvis/MSVis/SelectAverageSpw.h>
00052
00053
00054
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
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00108
00109 namespace casa {
00110
00111
00112 class MsAverager
00113 {
00114
00115 public:
00116 enum OutputMode {
00117 TableMS = 1,
00118 ListBuffer
00119 };
00120
00121 MsAverager(MS*, OutputMode = MsAverager::TableMS);
00122 ~MsAverager();
00123
00124 void reset(MS*, OutputMode = MsAverager::TableMS);
00125 void getMS(MS& ms);
00126 void getXY(Vector<Double>& x, Vector<Double>& y,
00127 Vector<Int>& f, Int pol);
00128 void getMap(Matrix<Int>& rowMap, Matrix<Int>& chanMap);
00129
00130
00131 void setAverager(
00132 const Matrix<Int>& chanList,
00133 const Matrix<Int>& baselines,
00134 Double aveTime, Int aveChan,
00135 const String& column = "DATA",
00136 const String& aveMode = "VECTOR",
00137 const Bool& aveFlag = False,
00138 const Bool& aveScan = False,
00139 const Bool& aveBline = False,
00140 const Bool& aveArray = False,
00141 const Bool& aveVelo = False,
00142 const String& restfreq = "",
00143 const String& frame = "",
00144 const String& doppler = "");
00145 Bool ok() {return aveOK;}
00146 Int outputFormat() {return outputMode;}
00147
00148 void showColumnNames();
00149 Bool isDataColumn(const String& colNmae);
00150 Bool hasColumn(const String& colName);
00151 static Int baselineRow(const Int& nAnt, const Int& a, const Int& b);
00152 Int baselineRow(const Int& a = -1, const Int& b = -1);
00153
00154 void putAveBuffer(Double bufTime, Int bufField, Int bufScan,
00155 Int bufArray, VisBuffer& p, Int nTime);
00156 void initAveBuffer(Double bufTime, VisBuffer& p, Int nAnt, Int nChan);
00157 void putAveTable(Double bufTime, Int bufField, Int bufScan,
00158 Int bufArray, Int bufSpw, VisBuffer& p, Int nTime,
00159 Double timeShift);
00160 void showVisRow(Cube<Complex>& vc, Int row);
00161 void showMsRow(MSMainColumns* msc, Int row);
00162 void showAveMap(Matrix<Int>& rmap, Matrix<Int>& cmap);
00163
00164 const static String DataColumn[4];
00165 Int npol() {return nAvePol;}
00166 Int nchan() {return nAveChan;}
00167 Int nAnt() {return nAntenna;}
00168
00169 private:
00170
00171 void cleanup();
00172 MS* pMS;
00173 VisSet* vs;
00174 String msName;
00175
00176
00177
00178 MS aMS;
00179 Int msRow;
00180 MSMainColumns *msc;
00181
00182
00183
00184 VisBuffer* pAveBuff;
00185 List<VisBuffer*> aveList;
00186
00187
00188 String column;
00189
00190
00191
00192
00193 Matrix<Int> chanList;
00194
00195 Vector<SAS> spw;
00196
00197
00198 Matrix<Int> aveChanMap;
00199
00200 Matrix<Int> aveRowMap;
00201
00202
00203 String aveMode;
00204 Double aveTime;
00205 Int aveChan;
00206 Bool aveFlag;
00207 Bool crossScans;
00208 Bool crossBlines;
00209 Bool crossArrays;
00210 Bool crossSpws;
00211 Bool aveVel;
00212 Bool sorryVel;
00213 Matrix<Int> baselines;
00214
00215
00216 Int nAveChan;
00217 Int nAveTime;
00218 Int nAveRow;
00219 Int nAvePol;
00220 Int nAntenna;
00221
00222 String restfreq;
00223 String frame;
00224 String doppler;
00225
00226 Bool aveOK;
00227
00228
00229 static const String clname;
00230
00231
00232 int outputMode;
00233
00234
00235 };
00236
00237
00238 }
00239 #endif
00240
00241