normalize_intensity#

EBSD.normalize_intensity(num_std: int = 1, divide_by_square_root: bool = False, dtype_out: Optional[Union[str, dtype, type]] = None, show_progressbar: Optional[bool] = None) None[source]#

Normalize image intensities in inplace to a mean of zero with a given standard deviation.

Parameters:
num_std

Number of standard deviations of the output intensities. Default is 1.

divide_by_square_root

Whether to divide output intensities by the square root of the signal dimension size. Default is False.

dtype_out

Data type of normalized images. If not given, the input images’ data type is used.

show_progressbar

Whether to show a progressbar. If not given, the value of hyperspy.api.preferences.General.show_progressbar is used.

Notes

Data type should always be changed to floating point, e.g. float32 with change_dtype(), before normalizing the intensities.

Rescaling RGB images is not possible. Use RGB channel normalization when creating the image instead.

Examples

>>> import numpy as np
>>> import kikuchipy as kp
>>> s = kp.data.nickel_ebsd_small()
>>> np.mean(s.data)
146.0670987654321
>>> s.normalize_intensity(dtype_out=np.float32)
>>> np.mean(s.data)
2.6373216e-08