Source
28
28
#define PLOTMSINDEXER_H_
29
29
30
30
#include <casa/aips.h>
31
31
#include <casa/Arrays.h>
32
32
#include <casa/Containers/Block.h>
33
33
#include <graphics/GenericPlotter/PlotData.h>
34
34
35
35
#include <plotms/PlotMS/PlotMSConstants.h>
36
36
#include <plotms/Data/PlotMSCacheBase.h>
37
37
38
-
38
+
#include <unordered_map>
39
39
40
40
namespace casa {
41
41
42
42
//# Forward declarations.
43
43
class PlotMSApp;
44
44
class PlotMSIndexer; // needed for method pointer typedefs
45
45
46
46
typedef casacore::Double(PlotMSCacheBase::*CacheMemPtr)(casacore::Int,casacore::Int);
47
47
typedef casacore::Int(PlotMSIndexer::*IndexerMethPtr)(casacore::Int,casacore::Int);
48
48
typedef void(PlotMSIndexer::*CollapseMethPtr)(casacore::Int,casacore::Array<casacore::Bool>&);
179
179
// get method for x and y axes depends on column
180
180
void setMethod(CacheMemPtr& getmethod, PMS::Axis axis, PMS::DataColumn data);
181
181
182
182
// index for iteraxis
183
183
void setIndexer(IndexerMethPtr& indexmethod, PMS::Axis axis);
184
184
185
185
// Reindex for connecting points
186
186
void reindexForConnect();
187
187
void getConnectSetsMaps(std::set<casacore::Double>& times, std::set<casacore::Int>& spws,
188
188
std::set<casacore::Int>& corrs, std::set<casacore::Int>& ant1s,
189
-
std::map<casacore::Int, casacore::Int>& chansPerSpw);
189
+
std::unordered_map<casacore::Int, casacore::Int>& chansPerSpw);
190
190
// all points in own bin
191
191
void setConnectBinsPerPt(casacore::Int npoints);
192
192
// reindex into one vector, by bin
193
193
void reindexBins(casacore::uInt npoints, std::vector<casacore::uInt>* chunks,
194
194
std::vector<casacore::uInt>* offsets);
195
195
// Bin data by various axes
196
-
void reindexForAllConnect(std::set<casacore::Double>& times, std::set<casacore::Int>& spws,
197
-
std::map<casacore::Int, casacore::Int>& chans, std::set<casacore::Int>& corrs,
198
-
std::set<casacore::Int>& ant1s, casacore::Vector<bool>& itermask);
199
-
void reindexForTimeConnect(std::set<casacore::Int>& spws,
200
-
std::map<casacore::Int,casacore::Int>& chans, std::set<casacore::Int>& corrs,
201
-
std::set<casacore::Int>& ant1s, casacore::Vector<bool>& itermask);
196
+
void reindexForAllConnect(const std::vector<casacore::Double>& times, const std::vector<casacore::Int>& spws,
197
+
std::unordered_map<casacore::Int, casacore::Int>& chans, const std::vector<casacore::Int>& corrs,
198
+
const std::vector<casacore::Int>& ant1s, Int npoints);
199
+
void reindexForTimeConnect(const std::vector<casacore::Int>& spws,
200
+
std::unordered_map<casacore::Int,casacore::Int>& chans, const std::vector<casacore::Int>& corrs,
201
+
const std::vector<casacore::Int>& ant1s, Int npoints);
202
202
// for GSPLINE:
203
-
void reindexForTimeConnectNoChans(std::set<casacore::Int>& spws,
204
-
std::set<casacore::Int>& corrs, std::set<casacore::Int>& ant1s, casacore::Vector<bool>& itermask);
205
-
void reindexForSpwConnect(std::set<casacore::Double>& times, casacore::Int nchans,
206
-
std::set<casacore::Int>& corrs, std::set<casacore::Int>& ant1s, casacore::Vector<bool>& itermask);
207
-
void reindexForChannelConnect(std::set<casacore::Double>& times, std::set<casacore::Int>& spws,
208
-
std::set<casacore::Int>& corrs, std::set<casacore::Int>& ant1s, casacore::Vector<bool>& itermask);
209
-
void reindexForCorrConnect(std::set<casacore::Double>& times, std::set<casacore::Int>& spws,
210
-
std::map<casacore::Int, casacore::Int>& chans, std::set<casacore::Int>& ant1s,
211
-
casacore::Vector<bool>& itermask);
212
-
void reindexForAnt1Connect(std::set<casacore::Double>& times, std::set<casacore::Int>& spws,
213
-
std::map<casacore::Int, casacore::Int>& chans, std::set<casacore::Int>& corrs,
214
-
casacore::Vector<bool>& itermask);
203
+
void reindexForTimeConnectNoChans(const std::vector<casacore::Int>& spws, const std::vector<casacore::Int>& corrs,
204
+
const std::vector<casacore::Int>& ant1s, Int npoints);
205
+
void reindexForSpwConnect(const std::vector<casacore::Double>& times, casacore::Int nchans,
206
+
const std::vector<casacore::Int>& corrs, const std::vector<casacore::Int>& ant1s, Int npoints);
207
+
void reindexForChannelConnect(const std::vector<casacore::Double>& times, const std::vector<casacore::Int>& spws,
208
+
const std::vector<casacore::Int>& corrs, const std::vector<casacore::Int>& ant1s, Int npoints);
209
+
void reindexForCorrConnect(const std::vector<casacore::Double>& times, const std::vector<casacore::Int>& spws,
210
+
std::unordered_map<casacore::Int, casacore::Int>& chans, const std::vector<casacore::Int>& ant1s,
211
+
Int npoints);
212
+
void reindexForAnt1Connect(const std::vector<casacore::Double>& times, const std::vector<casacore::Int>& spws,
213
+
std::unordered_map<casacore::Int, casacore::Int>& chans, const std::vector<casacore::Int>& corrs,
214
+
Int npoints);
215
215
216
216
// void setCollapser(CollapseMethPtr& collmethod, PMS::Axis axis);
217
217
218
218
// Generate collapsed versions of the plmask
219
219
/* not needed? (gmoellen, 2011Mar15)
220
220
void collapseMask0000(casacore::Int ch,casacore::Array<casacore::Bool>& collmask);
221
221
void collapseMask1000(casacore::Int ch,casacore::Array<casacore::Bool>& collmask);
222
222
void collapseMask0100(casacore::Int ch,casacore::Array<casacore::Bool>& collmask);
223
223
void collapseMask0010(casacore::Int ch,casacore::Array<casacore::Bool>& collmask);
224
224
void collapseMask0110(casacore::Int ch,casacore::Array<casacore::Bool>& collmask);