Closed Fokatu closed 1 year ago
Groups and datasets have the property
public IEnumerable<H5Attribute> Attributes
You can iterate using the IEnumerable and then read the contents of each attribute using the Read<T>()
method.
Thanks for your reply. My question is how to get the type of the attribute, i.e., the T for the function Read?
How to implement the above table?
To read a structure / compound, you could create a type that maps to the one in the HDF file: https://github.com/Apollo3zehn/HDF5.NET#structs-with-nullable-fields
To get the data type of an attribute, there is the Type
property. This gives you the type class but currently no further information. I have to expose more details to make that property useful. That's why its still an alpha stage project :-)
Do you mean that I cannot implement the function shown in the above image for arbitrary hdf5 file?
Yes, that is currently not possible. As a workaround you could clone the repo, make the DataTypeMessage property public and then implement your routine to read arbitrary structs. Here is a PR witch tries to solve the same problem: https://github.com/Apollo3zehn/HDF5.NET/pull/15
I will need some time to implement a proper solution to read arbitrary HDF5 structs. Until then the only way is follow the approach of Apollo3zehn/HDF5.NET#15 .
Reading unknown structs is now possible: https://github.com/Apollo3zehn/HDF5.NET#63-unknown-structs
This is a message I post to all recent issues: I have just renamed the project from HDF5.NET to PureHDF for my preparations of a soon to come beta release. Please note that the Nuget package name has also changed and can be found here now: https://www.nuget.org/packages/PureHDF.
traverse the attributes and show the corresponding contents. Thanks