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

◆ find()

const T & find ( const std::string name,
long  version = 0 
)

Access the first HDU with given name, type and version.

Template Parameters
TThe type of HDU or header or data unit handler
Parameters
nameThe HDU name
versionThe HDU version, or 0 to not check the version

The template parameter is used to disambiguate when two extensions of different types have the same name. For example, in a file with an image extension and a binary table extension both named "EXT", find<ImageHdu>("EXT") or find<ImageRaster>() return the image extension, while find<BintableHdu>("EXT") returns the binary table extension, and find<Hdu>("EXT") returns whichever of the two has the smallest index.

In the case where several HDUs have the same type, name and version (which is discouraged by the standard, but not forbidden), method read_hdu_names() should be used to get the indices and then access(long) should be called.

See also
access(long)
access(const std::string&)