wradlib.io.hdf.to_hdf5

Contents

wradlib.io.hdf.to_hdf5#

wradlib.io.hdf.to_hdf5(fpath, data, *, mode='w', metadata=None, dataset='data', compression='gzip')[source]#

Quick storage of one <data> array and a <metadata> dict in an hdf5 file

This is more efficient than pickle, cPickle or numpy.save. The data is stored in a subgroup named data (i.e. file[“data”]). See from_hdf5 for retrieving stored data.

Parameters:
  • fpath (str or file-like) – path to the hdf5 file or file-like object

  • data (numpy.ndarray)

  • mode (str) – file open mode, defaults to “w” (create, truncate if exists)

  • metadata (dict) – dictionary of data’s attributes

  • dataset (str) – describing dataset

  • compression (str) – h5py-compression type {“gzip”|”szip”|”lzf”}, see h5py-documentation for details