Hi, there. I am using HDF5 to store a variety of datasets, including a compound type dataset. For unit testing, I need to read a compound dataset, and while I can successfully open the dataset, it is not reading the desired double type value (instead, I get -9.2559631349317831e+61). Below is the function I have created to perform the read, following the example found here:
https://support.hdfgroup.org/HDF5/doc/cpplus_RM/compound_8cpp-example.html
My function:
static void readCompoundValue(char* filename, char* datasetname, char* paramname, double& value)
{
H5File* file = new H5File(filename, H5F_ACC_RDONLY);
DataSet* dataset = new DataSet(file->openDataSet(datasetname));
CompType mtype(sizeof(double));
mtype.insertMember(paramname, 0, PredType::NATIVE_DOUBLE);
double savedValue[1];
dataset->read(savedValue, mtype);
value = *savedValue;
}
Can anyone spot the issue? Thanks in advance.