CLASS can save a set of spectra with the command TABLE. It creates a 2D table using the Gildas Data Format (a header and rows of data). By default, the per-column format used is:
Such a table is ordered Velocity-Position (hereafter: VP), i.e. X, Y,
W and then the channels are contiguous in the file for each spectrum,
and the spectra are concatenated one after the other. This has some
advantages and disadvantages which are described in the
table
and compared to the opposite Position-Velocity
ordering (hereafter: PV).
From the items 1 and 2 in table
, it is obvious that the
result of the TABLE command must remain a Velocity-Position table.
However, the item 5 tends to show that Position-Velocity tables may be
interesting for efficient1
gridding, especially for tables which do not fit in memory and must
be read by blocks.
Transposing a Velocity-Position table can be done with the command
SICTRANSPOSE; the advantages and disadvantages are
detailed in the table
. The item 6 can be explained
like this: both VP items 3 and 5 (table
) and
stand-alone transposition (table
) need to traverse
the input table several times. However, because the former are part of
a larger problem (reading the table but also convolving, writing the
cube, memory transpositions if any), they can use only a smaller
amount of memory so they traverse the table more times (smaller blocks
and more of them are needed) than the stand-alone transposition. In
other words, and assuming the table does not fit in memory and that IO
dominate the problem, VP gridding is slower than transposition + PV
gridding. This is even more true if gridding is repeated several times
on the same table. A demonstration of these conclusions is shown in
table
.
| ||||||||||||
| Action | Traversing table | Elapsed time |
| XY_MAP (VP) | 1 (XYW) + 7 blocks | 8.2 min |
| TRANSPOSE (VP to PV) | 4 (in) + 1 (out) | 5.0 min |
| XY_MAP (PV) | 1 | 1.9 min |
From these conclusions, there is no unique answer to what kind of table should be feed in the gridding engine. The answer is a mixture of efficiency when creating or appending the table, and reading it. However, if the whole table fits in memory, i.e. it can be traversed once, then it is probably better to use a VP table. Then, if it must be read by parts, the PV order should be prefered.