Function utils::readDataset3D

Function Documentation

auto utils::readDataset3D(hid_t grp, const std::string &name, const std::string &context) -> std::pair<std::vector<double>, std::array<hsize_t, 3>>

Read a full 3D double dataset from an HDF5 group.

Parameters:
  • grp – Handle to the group (or already-open file) containing the dataset

  • name – Name of the dataset

  • context – Prefix used in thrown error messages (typically the name of the calling class or function)

Returns:

The dataset contents, flattened in the same row-major (C) order HDF5/h5py itself stores a multidimensional dataset in – i.e. element (i, j, k) of a dataset shaped (n0, n1, n2) is at flat index (i * n1 + j) * n2 + k – and its (n0, n1, n2) shape