EleFits  5.3.0
A modern C++ API on top of CFITSIO
Loading...
Searching...
No Matches

◆ access() [2/2]

const T & access ( long  index)

Access the HDU at given 0-based index.

Template Parameters
TThe type of HDU or header or data unit handler, i.e. ImageHdu, ImageRaster, BintableHdu, BintableColumns, Hdu or Header.
Returns
A reference to the HDU reader-writer.

Backward indexing is enabled. The default handler is Hdu, in which case the returned HDU can still be cast to another handler with Hdu::as(), e.g.:

const auto &ext = f.access<>(-1); // Same as f[-1]
auto raster = ext.as<ImageHdu>().raster().read<float>();
// Shortcut
auto raster = f.access<ImageRaster>(-1).read<float>();
Image HDU reader-writer.
Definition: ImageHdu.h:45
Reader-writer for the image data unit.
Definition: ImageRaster.h:31
See also
operator[]