Hi
I’m writing some C code with HDF5 1.10 (though the problem is also there with 1.8).
One set of files contains -
DATASET "pixel_mask" {
DATATYPE H5T_STD_U32LE
DATASPACE SIMPLE { ( 256, 1024 ) / ( 256, 1024 ) }
DATA {
(0,0): 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(0,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
etc...
h5dump -n shows that pixel_mask is here -
dataset /entry/instrument/detector/detectorSpecific/pixel_mask
I can read the values in pixel_mask okay if I declare pixel_mask in my code -
signed int pixel_mask = (signed int)malloc(sizeof(signed int) * xpixels * ypixels);
and read
H5LTread_dataset_int(hdf, “/entry/instrument/detector/detectorSpecific/pixel_mask”, pixel_mask);
The second set of files contain a different type of entry for the pixel_mask, indicated by an “EXTERNAL_LINK” (but the same data also occurs in the referencing file) -
EXTERNAL_LINK "pixel_mask" {
TARGETFILE "image_1508_meta.hdf5"
TARGETPATH "mask"
DATASET "mask" {
DATATYPE H5T_STD_U32LE
DATASPACE SIMPLE { ( 2167, 2070 ) / ( 2167, 2070 ) }
DATA {
(0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(0,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
and h5dump -n gives
ext link /entry/instrument/eiger/pixel_mask -> image_1508_meta.hdf5 mask
and exactly the same construction of C code will not read the data into the array indicated by the malloc.
I’ve tried reading the array directly from the linked file, but have had no more success.
I must be doing something wrong but I’ve run out of ideas.