Extract individual member fields from h5 file
Show older comments
I have some large h5 files that I am unable to efficiently bring into MATLAB. Each group in these large files (50+GB for some) turns into a structure with dozens of fields, each of which is a vector with millions of individual values. This overwhelms the RAM on my computer, so I am looking for a way to only extract the relative handful of fields that I actually need rather than importing the entire h5 group and then just deleting what I don't currently need.
So, for example, in the file indicated below I am looking for a way to extract perhaps just the timestamp and state vectors without importing the rest.
h5info([Source File{kk}],Group)
ans =
struct with fields:
Filename: 'D:\Data\Msg.h5'
Name: ''
Datatype: [1×1 struct]
Dataspace: [1×1 struct]
ChunkSize: 9000
FillValue: [1×1 struct]
Filters: []
Attributes: [2×1 struct]
Raw = h5read([Source File{kk}],Group)
Raw =
struct with fields:
Msg_msg_type: [1000000×1 uint8]
Msg_timestamp: {1000000×1 cell}
irig_time: {1000000×1 cell}
timestamp: [1000000×1 double]
log_msg: {1000000×1 cell}
state: {1000000×1 cell}
julian_date: [1000000×1 double]
Using the typical start and count options don't seem to work because, at the level they operate, there is only a 1x1 structure - i.e., a single unparseable item.
Any suggestions?
Accepted Answer
More Answers (0)
Categories
Find more on Data Preprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!