Update CFSimpleIndexer authored by Martin Pokorny's avatar Martin Pokorny
...@@ -103,14 +103,15 @@ We next must define mappings from indexes in the space defined by `subset_indexe ...@@ -103,14 +103,15 @@ We next must define mappings from indexes in the space defined by `subset_indexe
Finally we define the CF values through a `CFArray` sub-class instance with the appropriate element indexing operator (taking some liberties with C++ and CASA syntax): Finally we define the CF values through a `CFArray` sub-class instance with the appropriate element indexing operator (taking some liberties with C++ and CASA syntax):
```c++ ```c++
class MyCFArray : public hpg::CFArray { class MyCFArray : public hpg::CFArray {
unsigned m_w_value; unsigned m_w_map[1];
static const unsigned m_mueller_map[]{0, 5, 10, 15}; static const unsigned m_mueller_map[]{0, 5, 10, 15};
static const hpg::CFSimpleIndexer m_subset_indexer = subset_indexer; static const hpg::CFSimpleIndexer m_subset_indexer = subset_indexer;
casa::CFStore m_store; casa::CFStore m_store;
MyCFArray(unsigned w_value, const casa::CFStore& store) MyCFArray(unsigned w_value, const casa::CFStore& store)
: m_w_value(w_value) : m_store(store) {
, m_store(store) {} m_w_map[0] = w_value;
}
value_type value_type
operator()(unsigned x, unsigned y, unsigned mueller, unsigned cube, unsigned group) operator()(unsigned x, unsigned y, unsigned mueller, unsigned cube, unsigned group)
...@@ -119,7 +120,7 @@ class MyCFArray : public hpg::CFArray { ...@@ -119,7 +120,7 @@ class MyCFArray : public hpg::CFArray {
hpg::CellIndex ci = m_subset_indexer({mueller, cube, group}); hpg::CellIndex ci = m_subset_indexer({mueller, cube, group});
assert(ci.m_w_plane == 0); assert(ci.m_w_plane == 0);
assert(ci.m_mueller < 4); assert(ci.m_mueller < 4);
return m_store(ci.m_baseline_class, ci.m_time, m_w_value, ci.m_frequency, m_mueller_map[ci.m_mueller], x, y); return m_store(ci.m_baseline_class, ci.m_time, m_w_map[ci.m_w_plane], ci.m_frequency, m_mueller_map[ci.m_mueller], x, y);
} }
//... //...
... ...
......