- EBSD.remove_static_background(operation: str = 'subtract', static_bg: Optional[Union[ndarray, Array]] = None, scale_bg: bool = False, show_progressbar: Optional[bool] = None, inplace: bool = True, lazy_output: Optional[bool] = None) Union[None, EBSD, LazyEBSD] [source]#
Remove the static background.
The removal is performed by subtracting or dividing by a static background pattern. Resulting pattern intensities are rescaled loosing relative intensities and stretched to fill the available grey levels in the patterns’ data type range.
"divide"by the static background pattern.
Static background pattern. If not given, the background is obtained from the
Whether to scale the static background pattern to each individual pattern’s data range before removal. Default is
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
Background corrected signal, returned if
inplace=False. Whether it is lazy is determined from
It is assumed that a static background pattern of the same shape and data type (e.g. 8-bit unsigned integer,
uint8) as the patterns is available in signal metadata:
>>> import kikuchipy as kp >>> s = kp.data.nickel_ebsd_small() >>> s.static_background array([[84, 87, 90, ..., 27, 29, 30], [87, 90, 93, ..., 27, 28, 30], [92, 94, 97, ..., 39, 28, 29], ..., [80, 82, 84, ..., 36, 30, 26], [79, 80, 82, ..., 28, 26, 26], [76, 78, 80, ..., 26, 26, 25]], dtype=uint8)
The static background can be removed by subtracting or dividing this background from each pattern:
None, this must be passed in the
static_bgparameter as a