Problem reading HDF5 [message #88450] |
Sun, 27 April 2014 23:34  |
KCotar
Messages: 1 Registered: April 2014
|
Junior Member |
|
|
I am trying to read an image inside HDF5 file. According to the IDL Reference this should be pretty straight forward using the following code.
file = '***.HDF5'
fileId = H5F_OPEN(file)
ndviDataset = H5D_OPEN(fileId, '/LEVEL3/NDVI/NDVI')
ndviImage = H5D_READ(ndviDataset)
H5F_CLOSE, fileId
When running this code, I always get error: H5D_READ: can't read data: Object ID:83886129
The same thing happens if I try to open the image using graphical interface H5_BROWSER(file). Any idea what is wrong? It looks like broken data, however
HDFView can open it without read error.
Thanks.
|
|
|
Re: Problem reading HDF5 [message #88451 is a reply to message #88450] |
Mon, 28 April 2014 01:01  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
On Monday, April 28, 2014 8:34:32 AM UTC+2, KCotar wrote:
> I am trying to read an image inside HDF5 file. According to the IDL Reference this should be pretty straight forward using the following code.
>
>
>
> file = '***.HDF5'
>
> fileId = H5F_OPEN(file)
>
> ndviDataset = H5D_OPEN(fileId, '/LEVEL3/NDVI/NDVI')
>
> ndviImage = H5D_READ(ndviDataset)
>
> H5F_CLOSE, fileId
>
>
>
> When running this code, I always get error: H5D_READ: can't read data: Object ID:83886129
>
>
>
> The same thing happens if I try to open the image using graphical interface H5_BROWSER(file). Any idea what is wrong? It looks like broken data, however
>
> HDFView can open it without read error.
>
>
>
> Thanks.
Perhaps you need to open the group, LEVEL3, and then the group NVDI, before you can read it? i.e. using the H5G* commands?
|
|
|