Peak Finding

EVA.core.peak_finding.find_peaks.findpeak_with_bck_removed(x, y, h, t, d)

Filters out background signal using a mean pass filter and calls SciPy’s find_peaks() method on filtered signal.

Parameters:
  • x (ndarray) – input x-data

  • y (ndarray) – input y-data

  • h (float) – height threshold

  • t (float) – threshold for number of peaks within region

  • d (float) – minimum distance between peaks

Return type:

tuple[tuple[ndarray, dict], ndarray]

Returns:

SciPy find_peaks() result and ndarray of the x-values where peaks were detected.

EVA.core.peak_finding.find_peaks.findpeaks(x, y, h, t, d)

Wrapper for SciPy’s find_peaks() method.

Parameters:
  • x (ndarray) – input x-data

  • y (ndarray) – input y-data

  • h (float) – height threshold

  • t (float) – threshold for number of peaks within region

  • d (float) – minimum distance between peaks

Return type:

tuple[tuple[ndarray, dict], ndarray]

Returns:

SciPy find_peaks() result and ndarray of the x-values where peaks were detected.

EVA.core.peak_finding.find_peaks.meanfilter(data, filter_size=9)

Applies mean pass filter using np.convolve() by convolving data and np.ones(filter_size)/filter_size

Parameters:
  • data (ndarray | list) – input array

  • filter_size (int) – size of filter array for convolution

Return type:

ndarray

Returns:

Copy of data with mean filter applied