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

circular_mask#

pyxem.utils.diffraction.circular_mask(shape, radius, center=None)[source]#

Produces a mask of radius ‘r’ centered on ‘center’ of shape ‘shape’.

Parameters:
  • shape (tuple) – The shape of the signal to be masked.

  • radius (int) – The radius of the circular mask.

  • center (tuple (optional)) – The center of the circular mask. Default: (0, 0)

Returns:

mask – The circular mask.

Return type:

numpy.ndarray