modelica-3rdparty/ExternData

HDF5

Opened this issue · 6 comments

The releases page mentions HDF5, but it is not listed in the ReadMe, main features section.
https://github.com/tbeu/ExternData/releases
https://en.wikipedia.org/wiki/Hierarchical_Data_Format
Is this work in progress? Or part of .mat support?

tbeu commented

It currently is only as part of support for v7.3 MAT-files. No plain HDF5.

tbeu commented

v7.3 MAT-file actually is HDF5 with custom 128 bytes header and some defined attributes. You can use the standard HDF5 tools to work on v7.3 MAT-files.

I would be interested in the other way around, loading any standard HDF5 file content into Modelica, that is why I asked. Thanks for answering the question, I think this issue can be closed.

tbeu commented

Question is, what you mean by "standard HDF5 file content". HDF5 is like XML, that is you define the data and datagroup layout. If you use netCDF or v7.3 MAT (or also MTSF) files, they have done it for you.

Question is, what you mean by "standard HDF5 file content". HDF5 is like XML, that is you define the data and datagroup layout. If you use netCDF or v7.3 MAT (or also MTSF) files, they have done it for you.

I (not the OP) would mean to be able to point to a Dataset (inside a Group or not) in an HDF5 file with the appropriate dimensions and datatype and use that just like a Dataset from a .mat file.
E.g. in the lingo of Examples.Mattest, say timeTable(table=dataSource.getRealArray2D("group1/subgroup1/mytable", 3, 2))

That would make it easy to use this package (that effectively understands HDF5 already) to work with ~generic HDF5 (or even netCDF4?) files (e.g. from data acquisition hardware), if you don't have Matlab available.

OK, that seems like a nice addition.