next up previous contents
Next: About this document ... Up: Examples Previous: Reading a simple HDF5

Reading an HDF5 file containing a compound type

This example shows how an HDF5 file containing a compound type in it can be read. It will read the file ``compound_test.hdf'' that was generated above.

import _pyhl
import _rave_info_type

# There is no meaning creating the type
obj = _rave_info_type.object()
aList = _pyhl.read_nodelist(``compound_test.hdf'')

# Select everything for retrival
aList.selectAll()
aList.fetch()
aNode = aList.getNode(``/myCompoundAttribute'')

# Translate from the string representation to object
obj.fromstring(aNode.data())

# Display the values
print ``XSIZE=''+`obj.xsize`
print ``YSIZE=''+`obj.ysize`
print ``XSCALE=''+`obj.xscale`
print ``YSCALE=''+`obj.yscale`




2000-08-08