Gonna admit up front I have been out of the low level HDF5 API for a bit but I just got handed an HDF5 file that has a data set with a data type of “Array [2000] of 8 Bit unsigned integer type”. Now logically I understand what the data is. What I am unsure of is what C/C++ set of calls do I need to string together to read that data? Is there an example file in the HDF5 source that I could look at? Sorry for the basic questions, I’m just not sure what this is called so I’m not sure how to search for examples.
You may want to check out HDFql, a high-level (declarative) programming language that alleviates the user from HDF5 low-level details.
The following code snippet solves the issue you described in C:
// declare variable 'data'
unsigned char data[2000];
// register variable 'data' for subsequent use (by HDFql)
hdfql_variable_register(&data);
// read values from dataset 'dset' and populate variable 'data' with these
hdfql_execute("SELECT FROM dset INTO MEMORY 0");
// print values stored in variable 'data'
for(int i = 0; i < 2000; i++)
{
printf("%d\n", data[i]);
}
For additional information, please check HDFql reference manual.