save# str | None = None, overwrite: bool | None = None, extension: str | None = None, **kwargs) None[source]#

Write the signal to file in the specified format.

The function gets the format from the extension: h5, hdf5 or h5ebsd for kikuchipy’s specification of the h5ebsd format, dat for the NORDIF binary format or hspy for HyperSpy’s HDF5 specification. If no extension is provided the signal is written to a file in kikuchipy’s h5ebsd format. Each format accepts a different set of parameters.

This method is a modified version of HyperSpy’s function


If not given and tmp_parameters.filename and tmp_parameters.folder in signal metadata are defined, the filename and path will be taken from there. A valid extension can be provided e.g. "data.h5", see extension.


If not given and the file exists, it will query the user. If True (False) it (does not) overwrite the file if it exists.


Extension of the file that defines the file format. Options are "h5", "hdf5", "h5ebsd", "dat", "hspy". "h5", "hdf5", and "h5ebsd" are equivalent. If not given, the extension is determined from the following list in this order: i) the filename, ii) tmp_parameters.extension or iii) "h5" (kikuchipy’s h5ebsd format).


Keyword arguments passed to the writer.