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

intensity_peaks#

Diffraction2D.intensity_peaks(peak_array, disk_r=4, lazy_result=True, show_progressbar=True)[source]#

Get intensity of a peak in the diffraction data.

The intensity is calculated by taking the mean of the pixel values inside radius disk_r from the peak position.

Parameters:
  • peak_array (Numpy or Dask array) – Must have the same navigation shape as this signal.

  • disk_r (int) – Radius of the disc chosen to take the mean value of

  • lazy_result (bool, default True) – If True, will return a pyxem.signals.diffraction2d.LazyDiffraction2D object. If False, will compute the result and return a Diffraction2D object.

  • show_progressbar (bool, default True)

Returns:

intensity_array – Same navigation shape as this signal, with peak position in x and y coordinates and the mean intensity.

Return type:

Numpy or Dask array

Examples

>>> s = pxm.data.dummy_data.get_cbed_signal()
>>> peak_array = s.find_peaks_lazy()
>>> intensity_array = s.intensity_peaks(peak_array, disk_r=6)
>>> intensity_array_computed = intensity_array.compute()