Some things to keep in mind:
Background: singleRowTab is a table constisting of a single row. It is filled from the input FITS classes using the fillRow() member function. The nrows() member function returns the total number of FITS binary table rows and currrow() returns the current row number.
// Create an empty Table able to hold all remaining FITS rows, including
// the current one and having the same descriptor as singleRowTab
SetupNewTable newTab("FullTable", singleRowTab.getDescriptor(),
Table:New);
Table full(newTab, (nrows() - currrow() + 1));
// create the copier to copy all columns
RowCopier copier(full, singleRowTab);
// loop over all remaining rows
// since full was just created, we start filling it at row 0.
for (uInt outRow = 0, fitsRow = currrow(); fitsRow < nrows();
outRow++, fitsRow++) {
// copy the only row from currRowTab (row 0) to the outRow of full
copier.copy(outRow, 0);
// fill the next row of currRowTab
fillRow();
}
This example shows how to copy some of the values from one table to another. This is a contrived example. The input table has columns named "HSource" and "VSource" along with other columns. This example places the values from these columns to columns named "RA (1950)" and "DEC (1950)" in the output table (which also has other columns). Note that each input column must have the same type and dimensionality as the corresponding output column.
// construct a vector of the input column names to copy and the // associated output column names Vector<String> inColNames(2), outColNames(2); inColNames(0) = "HSource"; outColNames(0) = "RA (1950)" inColNames(1) = "VSource"; outColNames(1) = "DEC (1950)" // construct the copier RowCopier copier(inTable, outTable, inColNames, outColNames); // Copy a row from in to out, obviously a typical use would do // more than just one row. copier.copy(outRownr, outRownr-1);
This constructs a copier which will copy innames columns to outnames columns, outnames and innames must be conformant. Columns are matched up element-by-element in innames and outnames. An exception is thrown if an element of innames or outnames is not present in the corresponding table, if innames and outnames are not conformant and if the corresponding columns are not conformant (not the same type and not both scalar or both array columns)
The things that actually do the copying when requested.
Copy different row numbers.
The things that actually do the copying when requested.
Copy to and from the same row number