I want to open sub-directory of HDF5 file in Julia?
For example- how can i open
"Coordinates"
folder using HDF5.jl?
I want to open sub-directory of HDF5 file in Julia?
"Coordinates"
folder using HDF5.jl?
A “subdirectory” is called a “group” in HDF5. See the HDF5 documentation on opening groups.
Coordinates
is not a group. That is an attribute. See either attrs
or attributes
.
julia> data = h5open("data.h5", "r")
🗂️ HDF5.File: (read-only) data.h5
└─ 🏷️ Coordinates
julia> attrs(data)
AttributeDict of HDF5.Group: / (file: data.h5) with 1 attribute:
"Coordinates" => [12, 75]
julia> attrs(data)["Coordinates"]
2-element Vector{Int64}:
12
75
Or with attributes
:
julia> attributes(data)
🗂️ Attributes of HDF5.File: (read-only) data.h5
└─ 🏷️ Coordinates
julia> attributes(data)["Coordinates"]
🏷️ HDF5.Attribute: Coordinates
julia> attributes(data)["Coordinates"][]
2-element Vector{Int64}:
12
75
julia> read(attributes(data)["Coordinates"])
2-element Vector{Int64}:
12
75