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

add_ellipse_array_as_markers#

Diffraction2D.add_ellipse_array_as_markers(ellipse_array, inlier_array=None, peak_array=None)[source]#

Add a ellipse parameters array to a signal as HyperSpy markers.

Useful to visualize the ellipse results.

Parameters:
  • ellipse_array (NumPy array) – Array with ellipse parameters in the form (xc, yc, semi0, semi1, rot)

  • inlier_array (NumPy array, optional) – The inlier array is a boolean array returned by the determine_ellipse() algorithm to indicate which points were used to fit the ellipse.

  • peak_array (NumPy array, optional) – All of the points used to fit the ellipse.

Examples

>>> s, _ = pxm.data.dummy_data.get_simple_ellipse_signal_peak_array()
>>> ellipse_array = [128, 128, 20, 20, 0] # (xc, yc, semi0, semi1, rot)
>>> ellipse_array = [[128, ]]
>>> s.plot()
>>> e = s.add_ellipse_array_as_markers(ellipse_array)