EBSD.average_neighbour_patterns(window: str | ndarray | Array | Window = 'circular', window_shape: Tuple[int, ...] = (3, 3), show_progressbar: bool | None = None, inplace: bool = True, lazy_output: bool | None = None, **kwargs) None | EBSD | LazyEBSD[source]#

Average patterns with its neighbours within a window.

The amount of averaging is specified by the window coefficients. All patterns are averaged with the same window. Map borders are extended with zeros. Resulting pattern intensities are rescaled to fill the input patterns’ data type range individually.

Averaging is accomplished by correlating the window with the extended array of patterns using scipy.ndimage.correlate().


Name of averaging window or an array. Available types are listed in scipy.signal.windows.get_window(), in addition to a "circular" window (default) filled with ones in which corner coefficients are set to zero. A window element is considered to be in a corner if its radial distance to the origin (window center) is shorter or equal to the half width of the window’s longest axis. A 1D or 2D ndarray, Array or Window can also be passed.


Shape of averaging window. Not used if a custom window or Window is passed to window. This can be either 1D or 2D, and can be asymmetrical. Default is (3, 3).


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


Whether to operate on the current signal or return a new one. Default is True.


Whether the returned signal is lazy. If not given this follows from the current signal. Can only be True if inplace=False.


Keyword arguments passed to the available window type listed in get_window(). If not given, the default values of that particular window are used.


Averaged signal, returned if inplace=False. Whether it is lazy is determined from lazy_output.

Examples using EBSD.average_neighbour_patterns#

Neighbour pattern averaging

Neighbour pattern averaging