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

angular_mask#

Diffraction2D.angular_mask(angle0, angle1, centre_x_array=None, centre_y_array=None)[source]#

Get a bool array with True values between angle0 and angle1. Will use the (0, 0) point as given by the signal as the centre, giving an “angular” slice. Useful for analysing anisotropy in diffraction patterns.

Parameters:
  • angle0, angle1 (numbers)

  • centre_x_array, centre_y_array (NumPy 2D array, optional) – Has to have the same shape as the navigation axis of the signal.

Returns:

mask_array – The True values will be the region between angle0 and angle1. The array will have the same dimensions as the signal.

Return type:

numpy.ndarray

Examples

>>> s = pxm.data.dummy_data.get_holz_simple_test_signal()
>>> s.axes_manager.signal_axes[0].offset = -25
>>> s.axes_manager.signal_axes[1].offset = -25
>>> mask_array = s.angular_mask(0.5*np.pi, np.pi)