Check out the Hyperspy Workshop May 13-17, 2024 Online

subtract_diffraction_background#

Diffraction2D.subtract_diffraction_background(method='median kernel', inplace=False, **kwargs)[source]#

Background subtraction of the diffraction data.

Parameters:
  • method (str, optional) – ‘difference of gaussians’, ‘median kernel’, ‘radial median’, ‘h-dome’ Default ‘median kernel’.

    For difference of gaussians the parameters min_sigma (default:1) and max_sigma(default:55) control the size of the gaussian kernels used.

    For median kernel the footprint(default:19) parameter detemines the footprint used to determine the median.

    For radial median the parameters center_x(default:128), center_y(default:128) are used to detmine the center of the pattern to use to determine the median.

    For h-dome the parameter h detemines the relative height of local peaks that are supressed.

  • **kwargs – To be passed to the method chosen: min_sigma/max_sigma, footprint, centre_x,centre_y / h

Returns:

s

Return type:

pyxem.signals.Diffraction2D

Examples

>>> s = pxm.data.dummy_data.get_cbed_signal()
>>> s_r = s.subtract_diffraction_background(method='median kernel',
...     footprint=20, lazy_output=False, show_progressbar=False)
>>> s_r.plot()