|
◆ readTo() [1/3]
template<typename T >
void Euclid::Fits::BintableColumns::readTo |
( |
Column< T > & |
column | ) |
const |
Read a column into an existing Column .
- Parameters
-
column | The Column object to which data should be written, name of which is used to specify the column to be read 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.
|