|
◆ readTo() [3/3]
template<typename T >
void Euclid::Fits::BintableColumns::readTo |
( |
long |
index, |
|
|
Column< T > & |
column |
|
) |
| const |
Read the column with given index into an existing Column .
- Parameters
-
index | The index of the column to be read |
column | The Column object to which data should be written There are several ways to read a column, which can be specified either by its name or 0-based index. The simplest way is to read the whole column as a new VecColumn with methods read() . In this case, the value type is given as the template parameter. In order to store the column data in an existing Column (e.g. PtrColumn ), similar methods readTo() should be used. In this case, the value type is deduced and should not be specified. |
Example usages:
auto fromName = columns.read<float>("RA");
auto fromIndex = columns.read<float>(1);
PtrColumn<float> ra({ "RA", "deg", 1 }, rowCount, &values[0]);
columns.readTo("RA", ra);
columns.readTo("DEC", dec);
- Warning
- Methods
readTo() do not allocate memory: the user must ensure that enough space has been allocated previously.
|