load#

kikuchipy.load(filename: str | Path, lazy: bool = False, **kwargs) EBSD | EBSDMasterPattern | ECPMasterPattern | list[EBSD] | list[EBSDMasterPattern] | list[ECPMasterPattern][source]#

Load a supported signal from one of the Supported file formats.

Parameters:
filename

Name of file to load.

lazy

Open the data lazily without actually reading the data from disk until required. Allows opening arbitrary sized datasets. Default is False.

**kwargs

Keyword arguments passed to the corresponding kikuchipy reader. See their individual documentation for available options.

Returns:
out

Signal or a list of signals.

Raises:
IOError

If the file was not found or could not be read.

Notes

This function is a modified version of hyperspy.io.load().

Examples

Import nine patterns from an HDF5 file in a directory DATA_PATH

>>> import kikuchipy as kp
>>> s = kp.load(DATA_PATH / "patterns.h5")
>>> s
<EBSD, title: patterns Scan 1, dimensions: (3, 3|60, 60)>