Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The process of adding data to an extensible array dataset in HDF5 typically involves the following steps:

  1. Define a dataset: Create a dataset with the desired datatype, dataspace, and chunk size, and set the dataset creation property list (DCPL) to use chunking and compression for optimal performance.

  2. Extend the dataset: Initialize the dataset with an initial size, then extend the dataset as needed using the H5Dset_extent() function to increase the number of elements in the dataset. This increases the size of the dataset in the HDF5 file, and ensures that there is space available to append new data.

  3. Write data: Write the new data to the dataset using the H5Dwrite() function, specifying the location and size of the data in the dataset, and ensuring that the data is added to the end of the dataset.

  4. Close the dataset: Close the dataset when finished writing data to ensure that any changes are saved to the file.

  5. Repeat as needed: Repeat the process of extending and writing data as needed to add additional data to the dataset.

Overall, the process of adding data to an extensible array dataset in HDF5 involves creating a dataset with an initial size, extending the dataset to make room for new data, and then writing the new data to the dataset. This process can be repeated as needed to add additional data to the dataset over time.