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

center_of_mass#

pyxem.utils.diffraction.center_of_mass(z, mask=None, threshold=None)[source]#

Estimate direct beam position by calculating the center of mass of the image.

Parameters:
  • z (numpy.ndarray) – Two-dimensional data array containing signal.

  • mask (numpy.ndarray) – Two-dimensional data array containing mask.

  • threshold (float) – Threshold value for center of mass calculation.

Returns:

center – numpy.ndarray [x, y] containing indices of estimated direct beam positon.

Return type:

numpy.ndarray