get_decomposition_model_write#

LazyEBSD.get_decomposition_model_write(components: int | list[int] | None = None, dtype_learn: str | dtype | type = 'float32', mbytes_chunk: int = 100, dir_out: str | None = None, fname_out: str | None = None) → None[source]#

[Deprecated] Write the model signal generated from the selected number of principal components directly to an .hspy file.

The model signal intensities are rescaled to the original signals’ data type range, keeping relative intensities.

Parameters:
components

If not given, rebuilds the signal from all components. If int, rebuilds signal from components in range 0-given int. If list of int, rebuilds signal from only components in given list.

dtype_learn

Data type to set the model signal to (default is "float32") before rescaling intensities.

mbytes_chunk

Not used.

dir_out

Directory to place output signal in.

fname_out

Name of output signal file.

Notes

The same can be achieved with a lazy model signal, which is computed chunk by chunk when written to file:

>>> s_model = s.get_decomposition_model(
...     components, lazy_output=True
... )
>>> s_model.rescale_intensity(
...     relative=True, dtype_out=s.data.dtype
... )
>>> s_model.save("model.hspy")

Deprecated since version 0.15: Function get_decomposition_model_write() is deprecated and will be removed in version 0.17. Use get_decomposition_model() instead.