remove_dynamic_background#

kikuchipy.pattern.remove_dynamic_background(pattern: ndarray, operation: str = 'subtract', filter_domain: str = 'frequency', std: None | int | float = None, truncate: int | float = 4.0, dtype_out: str | dtype | type | Tuple[int, int] | Tuple[float, float] | None = None) ndarray[source]#

Remove the dynamic background in an EBSD pattern.

The removal is performed by subtracting or dividing by a Gaussian blurred version of the pattern. The blurred version is obtained either in the frequency domain, by a low pass Fast Fourier Transform (FFT) Gaussian filter, or in the spatial domain by a Gaussian filter. Returned pattern intensities are rescaled to fill the input data type range.

Parameters:
pattern

EBSD pattern.

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 not given, it is set to width/8.

truncate

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

dtype_out

Data type of corrected pattern. If not given, it is set to input patterns’ data type.

Returns:
corrected_pattern

Pattern with the dynamic background removed.