Skip to content

Home > Introduction > Input & Output Files > HDF5 file format

HDF5 file format

HDF5 is a flexible data model that enables to describe any data format. Any datatype can be stored in HDF5 file format. HDF5 is also a file format for storing and managing data. HDF5 is available as API in various languages to create, read and update HDF5 file formats. It is designed for flexible and complex data. HDF5 is portable and available for many languages and OS.

In DeepLines, HDF5 is proposed as a possible format for models and/or simulation files. Models can be saved as usual in binary format in .dsk file but could also be saved in HDF5 in .hdsk file format. The same way for simulation files that can now be saved in HDF5 file format in .hdss files format.

HDF5 manages compressed or uncompressed files formats, .hdsk and .hdss files are compressed HDF5 files.

Some official HDF5 tools (such as HDFView) can only handle uncompressed files. DeepLines generates an uncompressed HDF5 file named .dss.hdf5 or .dsk.hdf5 then compressed it (in .hdss or .hdsk) and deletes the uncompressed file. There is an option in settings to let the uncompressed file available on disk, for users wanting to use tools such as HDFView. HDFView is a visual tool for browsing and editing HDF5 files which allows viewing a HDF5 file hierarchy in a tree structure. HDFView is available at official HDF5 web site https://www.hdfgroup.org/downloads/hdfview/

It is possible to write a script, in Python or any other language, that can create, read or update a model or a simulation file in HDF5 format. It is recommended to start from an existing model and update it (even an empty one). Creating a new model from scratch in HDF5 by script is possible but remains complicated and error prone. It is also possible to read a HDF5 simulation file to check any value within the file using a Python script.

Two examples are provided in the directory Examples\09_HDF5 installed with the version that show how to write a script in Python using the h5py Python package. The h5py package is available at web site https://www.h5py.org/. It is recommended to download it and read the help menu. It is also recommended to use HDFView to have a look at the HDF file structure since the internal names of the model tree may differ from the names displayed in the GUI.

  • The first example is based on a typical free-hanging configuration and the python script "01_General_Queries.py" shows how to browse a model file. Different basic actions are demonstrated:
    • to look for all the objects (called "Shapes" in the HDF5 format);
    • to browse all groups and search for a specific riser name;
    • to browse the riser sections and, for each section, get the segments to display the segments lengths;
    • to get a value for a specific riser property.

In the same way, the python script shows how to get specific results for a HDSS file.

  • The second example focuses on the modification of the input data required to define non-linear bending; especially, it provides the way to convert experimental data into classical "C" and "Theta" parameters.