a simple mapping from one indexing system to another
Intended use:
Public interface
Review Status
- Date Reviewed:
- yyyy/mm/dd
Etymology
This class is puts an index on an ordered list of IDs.
Synopsis
Suppose that you have a list of things accessed via an index (i.e. an integer ID), say spectral windows. Suppose further you want to map them into some other index system, perhaps because you are reordering them. This simple class can keep track of the mapping between the two systems.
The mapping is set up through sequenced calls to the add()
function, to which indices from the "input" system are passed. The order that the indices are passed indicate their order in the output system. One can then map to the output system by passing the input index to the () operator.
One sets the index that the first input index will be mapped to via the constructor, allowing one to map, for example, {1, 3, 2} into {4, 5, 6}.
Example
Suppose only selected windows will be written out. Here's how we can keep track of the mapping:
if (windowSelected(i)) idx.add(i)
}
Motivation
The MirFiller class needs to keep track of which Miriad windows get mapped into which casacore::MS spectral windows. Since the user can select which windows will be loaded, its not easy to predict otherwise how the windows will get mapped. Furthermore, Miriad wideband channels are loaded as seperate windows in the output casacore::MS, thus the mapping from channel number to window will not necessarily start with 0.
Definition at line 87 of file IDIndex.h.