I would like to access data in an HDF5 file with the name
"/run_466/tof_detector_1/single_events_x" in a C/C++ program.
single_events_x is a linear array. The name "run_466" may vary between
filename, but I assume that tof_detector_1 does not.
Since my example file only contain one group in / (the variable
"run_466") I though of getting this name with the function
then append /tof_detector_1/single_events_x to that string to pass it to
I have not managed from reading the online documentation, hence the
1) is there an easier approach to access
2) if this is the correct approach, how do I call H5Lget_name_by_idx
correctly? I find it difficult to figure out the meaning of H5_index_t
index_field, H5_iter_order_t order, and hid_t lapl_id from the
3) I assume that once the Data are opened, the appropriate way to access
single_events_x (a linear array of integers) is
H5Dread( hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t
file_space_id, hid_t xfer_plist_id, void * buf )
again, the documentation tells me what all the things like mem_type_id,
mem_space_id etc. are, but how to I set them properly? Or is there a
direct access function that simple returns a single integer so that I
can access the data one by one?
Thanks a lot for any help,
P.S.: I posted a related question on 28/5/2014 where I was pointed at
H5Literate by Werner Benger, but firstly there is only one group of
unknown name in /, so I though iterating was not necessary, and
secondly, as pointed out above, I find it difficult to read the
documentation and figure out how to define the required input fields. I
hope this post is more specific.
Dr Tim Gruene
Institut fuer anorganische Chemie
GPG Key ID = A46BEE1A