- EBSD.fft_filter(transfer_function: ndarray | Window, function_domain: str, shift: bool = False, show_progressbar: bool | None = None, inplace: bool = True, lazy_output: bool | None = None) None | EBSD | LazyEBSD #
Filter patterns in the frequency domain.
Patterns are transformed via the Fast Fourier Transform (FFT) to the frequency domain, where their spectrum is multiplied by the
transfer_function, and the filtered spectrum is subsequently transformed to the spatial domain via the inverse FFT (IFFT). Filtered patterns are rescaled to input data type range.
Note that if
"spatial", only real valued FFT and IFFT is used.
Filter to apply to patterns. This can either be a transfer function in the frequency domain of pattern shape or a kernel in the spatial domain. What is passed is determined from
"spatial", indicating, respectively, whether the filter function passed to
filter_functionis a transfer function in the frequency domain or a kernel in the spatial domain.
Whether to shift the zero-frequency component to the center. Default is
False. This is only used when
Whether to show a progressbar. If not given, the value of
Whether to operate on the current signal or return a new one. Default is
Whether the returned signal is lazy. If not given this follows from the current signal. Can only be
Filtered signal, returned if
inplace=False. Whether it is lazy is determined from
Applying a Gaussian low pass filter with a cutoff frequency of 20:
>>> import kikuchipy as kp >>> s = kp.data.nickel_ebsd_small() >>> pattern_shape = s.axes_manager.signal_shape[::-1] >>> w = kp.filters.Window( ... "lowpass", cutoff=20, shape=pattern_shape ... ) >>> s.fft_filter( ... transfer_function=w, ... function_domain="frequency", ... shift=True, ... )