hyperspy.io_plugins.hspy module

hyperspy.io_plugins.hspy.dict2hdfgroup(dictionary, group, **kwds)

Recursive writer of dicts and signals

hyperspy.io_plugins.hspy.file_reader(filename, backing_store=False, lazy=False, **kwds)

Read data from hdf5 files saved with the hyperspy hdf5 format specification

Parameters
  • filename (str) –

  • lazy (bool) – Load image lazily using dask

  • **kwds

  • optional

hyperspy.io_plugins.hspy.file_writer(filename, signal, *args, **kwds)

Writes data to hyperspy’s hdf5 format

Parameters
  • filename (str) –

  • signal (a BaseSignal instance) –

  • *args

  • optional

  • **kwds

  • optional

hyperspy.io_plugins.hspy.get_signal_chunks(shape, dtype, signal_axes=None)

Function that calculates chunks for the signal, preferably at least one chunk per signal space.

Parameters
  • shape (tuple) – the shape of the dataset to be sored / chunked

  • dtype ({dtype, string}) – the numpy dtype of the data

  • signal_axes ({None, iterable of ints}) – the axes defining “signal space” of the dataset. If None, the default h5py chunking is performed.

hyperspy.io_plugins.hspy.write_signal(signal, group, **kwds)

Writes a hyperspy signal to a hdf5 group