remove_dynamic_background#

EBSD.remove_dynamic_background(operation: str = 'subtract', filter_domain: str = 'frequency', std: Union[None, int, float] = None, truncate: Union[int, float] = 4.0, show_progressbar: Optional[bool] = None, **kwargs) None[source]#

Remove the dynamic background in an EBSD scan inplace.

The removal is performed by subtracting or dividing by a Gaussian blurred version of each pattern. Resulting pattern intensities are rescaled to fill the input patterns’ data type range individually.

Parameters:
operation

Whether to "subtract" (default) or "divide" by the dynamic background pattern.

filter_domain

Whether to obtain the dynamic background by applying a Gaussian convolution filter in the "frequency" (default) or "spatial" domain.

std

Standard deviation of the Gaussian window. If None (default), it is set to width/8.

truncate

Truncate the Gaussian window at this many standard deviations. Default is 4.0.

show_progressbar

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

**kwargs

Keyword arguments passed to the Gaussian blurring function determined from filter_domain.

Examples

Remove the static and dynamic background

>>> import kikuchipy as kp
>>> s = kp.data.nickel_ebsd_small()
>>> s.remove_static_background()
>>> s.remove_dynamic_background(operation="divide", std=5)