threshold_and_mask#
- Diffraction2D.threshold_and_mask(threshold=None, mask=None, show_progressbar=True)[source]#
Get a thresholded and masked of the signal.
Useful for figuring out optimal settings for the
pyxem.signals.Diffraction2D.center_of_mass()
method.- Parameters:
threshold (number, optional) – The thresholding will be done at mean times this threshold value.
mask (tuple (x, y, r)) – Round mask centered on x and y, with radius r.
show_progressbar (bool) – Default True
- Returns:
s_out
- Return type:
Examples
>>> s = pxm.data.dummy_data.get_disk_shift_simple_test_signal() >>> mask = (25, 25, 10) >>> s_out = s.threshold_and_mask( ... mask=mask, threshold=2, show_progressbar=False) >>> s_out.plot()
See also