Does anybody have a workaround in Mathematica for reading HDF5 compound arrays? I have a simple 2D compound type (int/float) in a table but it is currently ignored.
An example HDF5 type might be:
DATATYPE H5T_COMPOUND {
H5T_IEEE_F32LE "X";
H5T_IEEE_F32LE "Y";
}
There is a package, apparently created by Scot Martin here.
As far as I can see, it implements a lot of the HDF5 functionality, including Compound Types.
Here is a brief snippet from 11 HDF5HighLevel Examples.nb
in the package:
With[
{
file = FileNameJoin[{Directory[], subfolderWithExamples, "h5ex_t_cmpd.h5"}],
dataSet = "DS1"
},
CompoundDataType`Information[file, dataSet]
]
(*
{"DataSpaceDimensions" -> {4},
"MemberDataTypeClass" -> {0, -3, 1, 1},
"MemberMemorySize" -> {8, 8, 8, 8},
"MemberName" -> {"Serial number" , "Location",
"Temperature (F)", "Pressure (inHg)"},
"MemberOffset" -> {0, 8, 20, 28},
"MemberSize" -> {8, 8, 8, 8},
"MemoryDataTypeSize" -> 32,
"NumberOfMembers" -> 4}
*)
HTH!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With