peak_persistence#

metpy.calc.peak_persistence(arr, *, maxima=True)[source]#

Return all local extrema points ordered by their persistence.

This uses the concept of persistent homology to find peaks ordered by their persistence. [Huber2021] This essentially works akin to a falling water level and seeing how long a peak persists until the falling level allows connection to a larger, neighboring peak. NaN points are ignored.

Parameters:
  • arr (array-like) – 2-dimensional array of numeric values to search

  • maxima (bool, optional) – Whether to find local maxima, defaults to True. If False, local minima will be found instead.

Returns:

list[((int, int), float)] – Point indices and persistence values in descending order of persistence

See also

find_peaks