Index Module Index Search Page

qnd.h5f module

QnD wrapper for h5py HDF5 interface.

qnd.h5f.openh5(filename, mode='r', auto=1, **kwargs)[source]

Open HDF5 file using h5py, but wrapped as a QnD QGroup.

Parameters:
  • filename (str) – Name of file to open. If filename contains %d format directive, open a family of files (the memb_size keyword controls file size).
  • mode (str) – One of ‘r’ (default, read-only), ‘r+’ (read-write, must exist), ‘a’ (read-write, create if does not exist), ‘w’ (create, clobber if exists), ‘w-’ (create, fail if exists).
  • auto (int) – The intial state of auto-read mode. If the QGroup handle returned by openh5 is f, then f.varname reads an array variable, but not a subgroup when auto=1, the default. With auto=0, the variable reference reads neither (permitting later partial reads in the case of array variables). With auto=2, a variable reference recursively reads subgroups, bringing a whole tree into memory.
  • **kwargs – Other keywords passed to h5py.File constructor. Note that the driver=’family’ keyword is implicit if filename contains %d.
Returns:

f – A file handle implementing the QnD interface.

Return type:

QGroup