Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DATATYPE H5T_COMPOUND {
- H5T_IEEE_F32LE "X";
- H5T_IEEE_F32LE "Y";
- }
- 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}
- *)
- Needs["h5dumpImport`"]
- datasets = Import["testData.h5", {"Datasets"}];
- dumpFile = h5dump["/usr/bin/h5dump", "testData.h5", datasets[[1]]];
- dumpImport = h5dumpImportNew[h5dumpImport[], dumpFile];
- dumpImport.h5dumpImportData[All]
- dumpImport.h5dumpImportClose[];
- {{1, 11, 111, 1111, 11111, 111111, 1111111, 1.1, 11.11, "one"},
- {2, 22, 222, 2222, 22222, 222222, 2222222, 2.2, 22.22, "two"},
- {3, 33, 333, 3333, 33333, 333333, 3333333, 3.3, 33.33, "three"}}
- In[3]:= Import["ExampleData/sample2.h5", "/Compound"]
- Out[3]= {
- {
- <|
- "Country" -> "Botswana",
- "Military" -> {5.3, 4.5},
- "Elevation" -> <|"Max" -> 4892, "Min" -> 513, "Highest point" -> "Otse Hill"|>
- |>,
- <|
- "Country" -> "Chile",
- "Military" -> {8.8, 3.7},
- "Elevation" -> <|"Max" -> 6893, "Min" -> 0, "Highest point" -> "Ojos del Salado"|>
- |>
- }, {
- <|
- "Country" -> "France",
- "Military" -> {5.3, 3.3},
- "Elevation" -> <|"Max" -> 4810, "Min" -> -10, "Highest point" -> "Mont Blanc"|>
- |>,
- <|
- "Country" -> "Laos",
- "Military" -> {18.9, 4.3},
- "Elevation" -> <|"Max" -> 2817, "Min" -> 70, "Highest point" -> "Phou Bia"
- |>
- |>
- }}
- In[2]:= Import["ExampleData/sample2.h5", {"DataFormat", "/Compound"}]
- Out[2]= <|
- "Class" -> "Compound",
- "Structure" -> <|
- "Country" -> "String",
- "Military" -> <|"Class" -> "Array", "Dimensions" -> {2}, "DataFormat" -> "Real64"|>,
- "Elevation" -> <|
- "Class" -> "Compound",
- "Structure" -> <|"Max" -> "Integer16", "Min" -> "Integer16", "Highest point" -> "String"|>
- |>
- |>
- |>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement