next up previous contents
Next: Positions interpolation Up: Chunks and chunksets Previous: Chunks and chunksets   Contents

Chunks slicing

In order to be able to make calibration at a bandwidth smaller than the hardware chunks, MRTCAL is able to map the raw data block read with CFITSIO into smaller memory chunks. The main advantage is that this approach has very well defined boundaries: when the IMBFITS BACKEND table is read, it can be replaced on-the-fly with its sliced version. All the rest of the code does not have to know this happened. The downside is that the more memory chunks are defined, the more overheads they carry (e.g. description of their spectroscopic axis, calls to chunk-by-chunk subroutines, stitching, etc). Experience shows that slicing the 1400 MHz of FTS chunks into 14 chunks of 100 MHz introduces a penalty of 10% in the whole computation time (reading, slicing, calibrating, writing).

In practice, user can request the bandwidth he wishes. In order to slice the USED channels into comparable pieces, MRTCAL will choose the nearest bandwidth which gives an integer number of slices:

\begin{displaymath}
N = nint \left( \frac{USED \times \vert SPACING\vert}{W} \right)
\end{displaymath} (1)

where W is the requested bandwidth. $N$ must also be corrected so that there is at least 1 and at most USED channels per subchunk:
\begin{displaymath}
USED \ge N \ge 1
\end{displaymath} (2)

While the CHANS value (total number of channels) is often a multiple of 2, USED channels have no special value. In particular, it may not be a multiple of $N$. Their relationship can be written as:

\begin{displaymath}
USED = q \times N + r
\end{displaymath} (3)

where $q$ and $r$ are respectively the integer quotient and the remainder of the division $USED/N$. Since $0 \le r \le N-1$, USED can be divided in $N$ subchunks, $r$ of them having one extra channel:
\begin{displaymath}
USED = (q \times (N-r)) + ( (q+1) \times r)
\end{displaymath} (4)

This gives the best channels division and a negligible difference of subchunks bandwidth.

Figure 3: Hardware chunks can be virtually divided into smaller pieces just by redefining the BACKEND table. In this example, the table is sliced from 1 chunk to 3 subchunks (3 times more lines in the table). The same raw data block read with CFITSIO will be mapped by Mrtcal with a larger number of memory chunks.
Image imbfits-subchunks

ZZZ Say a word about the ``famous'' special channel with its half weight. Slicing does not have any special problem with it.


next up previous contents
Next: Positions interpolation Up: Chunks and chunksets Previous: Chunks and chunksets   Contents
Gildas manager 2014-07-01