skued.azimuthal_average

skued.azimuthal_average(image, center, mask=None, angular_bounds=None, trim=True)

This function returns an azimuthally-averaged pattern computed from an image, e.g. polycrystalline diffraction.

Parameters:
  • image (array_like, shape (M, N)) – Array or image.

  • center (array_like, shape (2,) or None, optional) – coordinates of the center (in pixels). If center=(xc, yc), then image[yc, xc] is the intensity at the center of the image.

  • mask (~numpy.ndarray or None, optional) – Evaluates to True on valid elements of array.

  • angular_bounds (2-tuple or None, optional) – If not None, the angles between first and second elements of angular_bounds (inclusively) will be used for the average. Angle bounds are specified in degrees. 0 degrees is defined as the positive x-axis. Angle bounds outside [0, 360) are mapped back to [0, 360).

  • trim (bool, optional) – If True, leading and trailing zeros (possible due to the usage of masks) are trimmed.

Returns:

  • radius (~numpy.ndarray, ndim 1) – Radius of the average [px]. radius might not start at zero, depending on the trim parameter.

  • average (~numpy.ndarray, ndim 1) – Angular-average of the array.