modelica-3rdparty / ExternData

:page_facing_up: Modelica library for data I/O of CSV, INI, JSON, MATLAB MAT, SSV, TIR, Excel XLS/XLSX and XML files
https://doi.org/10.3384/ecp21181141
BSD 2-Clause "Simplified" License
74 stars 30 forks source link

HDF5 #13

Open thorade opened 7 years ago

thorade commented 7 years ago

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 7 years ago

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

tbeu commented 7 years ago

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.

thorade commented 7 years ago

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 7 years ago

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.

bilderbuchi commented 1 year ago

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.

beutlich commented 1 year ago

OK, that seems like a nice addition.