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

find_beam_offset_cross_correlation#

pyxem.utils.diffraction.find_beam_offset_cross_correlation(z, radius_start, radius_finish, **kwargs)[source]#

Find the offset of the direct beam from the image center by a cross-correlation algorithm. The shift is calculated relative to an circle perimeter. The circle can be refined across a range of radii during the centring procedure to improve performance in regions where the direct beam size changes, e.g. during sample thickness variation.

Parameters:
  • z (numpy.ndarray) – The two dimensional array/image that is operated on

  • radius_start (int) – The lower bound for the radius of the central disc to be used in the alignment.

  • radius_finish (int) – The upper bounds for the radius of the central disc to be used in the alignment.

  • **kwargs – Any additional keyword arguments defined by skimage.registration.phase_cross_correlation()

Returns:

shift – numpy.ndarray [y, x] containing offset (from center) of the direct beam positon.

Return type:

numpy.ndarray