I’m trying to read one element of a dataset of doubles [360][719][10][17] at [179][358][0][0] with the following code which crashes performing the H5Dread. Ideas?
Thanks,
Scott
long[] start = { 179, 358, 0, 0 };
long[] stride = { 1, 1, 1, 1 };
long[] count = { 1, 1, 1, 1 };
long[] block = { 1, 1, 1, 1 };
double[][][][] dsetData = new double[1][1][1][1];
dsetData[0][0][0][0] = -423.1958;
long filespaceId;
try {
filespaceId = H5.H5Dget_space(valuesDatasetId);
int ndims = H5.H5Sget_simple_extent_ndims(filespaceId);
long[] dims = new long[ndims];
long[] maxdims = new long[ndims];
H5.H5Sget_simple_extent_dims(filespaceId, dims, maxdims);
H5.H5Sselect_hyperslab(filespaceId, HDF5Constants.H5S_SELECT_SET, start, stride, count, block);
H5.H5Dread(valuesDatasetId, HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5S_ALL, filespaceId,
HDF5Constants.H5P_DEFAULT, dsetData);
} catch (NullPointerException | IllegalArgumentException | HDF5Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}