skued.bragg_peaks

skued.bragg_peaks(im, mask=None, center=None, min_dist=None)

Extract the position of Bragg peaks in a single-crystal diffraction pattern.

New in version 2.1.3.

Parameters:
  • im (ndarray, shape (N,M)) – Single-crystal diffraction pattern.

  • mask (ndarray, shape (N,M), dtype bool, optional) – Mask that evaluates to True on valid pixels of im.

  • center (2-tuple, optional) – Center of the diffraction pattern, in (row, col) format. If None, the center will be determined via autocenter().

  • min_dist (float or None, optional) – Minimum distance between Bragg peaks (in pixel coordinates). Peaks that are closer than this distance will be considered the same peak, and only one of them will be returned. If None (default), the minimum distance is guessed based on the image size.

Returns:

peaks – List of coordinates [row, col] for every detected peak, sorted in order of how close they are to the center of the image.

Return type:

list of 2-tuples

References

Liu, Lai Chung. Chemistry in Action: Making Molecular Movies with Ultrafast Electron Diffraction and Data Science, Chapter 2. Springer Nature, 2020.