Function utils::readScalarAttrIfPresent

Function Documentation

auto utils::readScalarAttrIfPresent(hid_t obj, const std::string &name) -> std::optional<double>

Read a scalar double attribute from an HDF5 object, if present.

Parameters:
  • obj – Handle to the object (a group or a dataset)

  • name – Name of the attribute

Returns:

The attribute’s value, or an empty optional if the object has no attribute of that name