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

◆ readSegmentTo() [1/3]

template<typename T >
void Euclid::Fits::BintableColumns::readSegmentTo ( FileMemSegments  rows,
Column< T > &  column 
) const

Read the segment of a column into an existing Column.

Parameters
rowsThe included lower and upper bounds of the row indices to be read
nameThe name of the column to be read
indexThe 0-based index of the column to be read
columnThe preexisting Column to be filled

Methods to read column segments are similar to methods to read complete columns (see read()). They accept an additional parameter to specify the rows to be read, as the bounds of a closed interval.

Example usages:

// Create a new Column
auto segment = columns.readSegment<float>({ 10, 50 }, "NAME");
// Read into an existing Column
// This is a more complex example which demonstrates the use of offsets
Segment sourceBounds = { 10, 50 };
long destinationRow = 20;
std::vector<float> values(100);
PtrColumn<float> segment({ "NAME", "m/s", 1 }, 20, &values[destinationRow]);
columns.readSegmentTo(sourceBounds, "NAME", segment);
See also
read()
std::vector
STL class.