EleFits  4.0.0
A modern C++ API on top of CFitsIO

◆ readTo() [1/3]

template<typename T >
void Euclid::Fits::BintableColumns::readTo ( Column< T > &  column) const

Read a column into an existing Column.

Parameters
columnThe 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:

// Create a new Column
auto fromName = columns.read<float>("RA");
auto fromIndex = columns.read<float>(1);
// Concatenate two columns into an existing Column
std::vector<float> values(rowCount * 2);
PtrColumn<float> ra({ "RA", "deg", 1 }, rowCount, &values[0]);
PtrColumn<float> dec({ "DEC", "deg", 1 }, rowCount, &values[rowCount]);
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.
Euclid::Fits::BintableColumns::readRowCount
long readRowCount() const
Get the current number of rows.
std::vector
STL class.
std::dec
T dec(T... args)
Euclid::Cfitsio::BintableIo::rowCount
long rowCount(fitsfile *fptr)
Get the number of rows.