average_neighbour_patterns#
- EBSD.average_neighbour_patterns(window: Union[str, ndarray, Array, Window] = 'circular', window_shape: Tuple[int, ...] = (3, 3), show_progressbar: Optional[bool] = None, inplace: bool = True, lazy_output: Optional[bool] = None, **kwargs) Union[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()
.- Parameters:
- window
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 2Dndarray
,Array
orWindow
can also be passed.- window_shape
Shape of averaging window. Not used if a custom window or
Window
is passed towindow
. This can be either 1D or 2D, and can be asymmetrical. Default is(3, 3)
.- show_progressbar
Whether to show a progressbar. If not given, the value of
hyperspy.api.preferences.General.show_progressbar
is used.- inplace
Whether to operate on the current signal or return a new one. Default is
True
.- lazy_output
Whether the returned signal is lazy. If not given this follows from the current signal. Can only be
True
ifinplace=False
.- **kwargs
Keyword arguments passed to the available window type listed in
get_window()
. If not given, the default values of that particular window are used.
- Returns:
s_out
Averaged signal, returned if
inplace=False
. Whether it is lazy is determined fromlazy_output
.