Some HDF5 helper routines
posted Fri 27 Jun 2008 by Michael Galloy under IDLI use HDF5 quite a bit and have developed some utility routines, mg_h5_dump (docs, code) and mg_h5_getdata (docs, code), that are quite useful for me.
mg_h5_dump gives similar output to the command line utility h5dump with -A set. mg_h5_getdata allows slices of data to be extracted using IDL's normal indexing rules.
For example,
IDL> f = filepath('hdf5_test.h5', subdir=['examples', 'data'])
IDL> data = mg_h5_getdata(f, '/arrays/3D int array', $
IDL> bounds='3, 5:*:2, 0:49:3')
IDL> data = mg_h5_getdata(f, '/arrays/3D int array', $
IDL> bounds='3, 5:*:2, 0:49:3')
For more examples, run the main-level programs at the end of the routines:
IDL> .run mg_h5_getdata
IDL> .run mg_h5_dump
IDL> .run mg_h5_dump
