|
◆ readTo() [2/3]
template<typename T >
void Euclid::Fits::BintableColumns::readTo |
( |
const std::string & |
name, |
|
|
Column< T > & |
column |
|
) |
| const |
Read the column with given name into an existing Column .
- Parameters
-
name | The name of the column to be read |
column | The Column object to which data should be written (column.name is not used by the method and can be different from the name parameter) 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.
|