Re: HDF5 data [message #53598] |
Fri, 20 April 2007 15:27 |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
On Apr 20, 3:48 pm, Orion Poplawski <o...@cora.nwra.com> wrote:
> Does anyone know how to read *part* of a dataset stored in an HDF5 file?
>
> Currently we're doing something like:
>
> voltdataset=H5D_OPEN(fn,"RAW11/Data/Samples/Data")
> VoltagesArray=H5D_READ(voltdataset)
>
> But this is a float array of 2,1000,2500,50 and is too big to allocate
> on a 32-bit machine. We'd like to return a subset of the data.
>
> - Orion
The following is based entirely upon reading the IDL HDF5
documentation; I have no personal experience with HDF5 files, only
with HDF4.
You need to use the FILE_SPACE or MEMORY_SPACE arguments to H5D_READ.
These arguments are dataspace identifiers. You have to use the H5S_*
functions to create and manipulate dataspaces. You pass the dimensions
of the offset that you want to H5S_CREATE_SIMPLE(), and pass the
starting position to H5S_OFFSET_SIMPLE. Hopefully you won't need to
create more complicated subsets, but if you do, you can use
H5S_SELECT_HYPERSLAB. Don't forget to call H5S_CLOSE when you're done
with a dataspace.
|
|
|