xboa
Public Member Functions | Public Attributes | List of all members
WindowPeakFinder Class Reference

Find peaks in a list of data points by looking for the peak within a window. More...

Inherits object.

Public Member Functions

def __init__
 Initialise the peak finder. More...
 
def find_peaks
 Find peaks in the data. More...
 

Public Attributes

 window_size
 
 threshold
 
 window_step
 

Detailed Description

Find peaks in a list of data points by looking for the peak within a window.

This algorithm will ignore subpeaks that are close to the main peak (assuming e.g. that they are noise)

Definition at line 24 of file _window_peak_finder.py.

Constructor & Destructor Documentation

def __init__ (   self,
  window_size,
  threshold_over_mean,
  window_step 
)

Initialise the peak finder.

  • window_size integer size of the window over which we look for peaks.
  • threshold_over_mean float, require the peak to be greater than a multiple of the data mean within the window to be registered
  • window_step float, move the window by window_step on each iteration

Definition at line 33 of file _window_peak_finder.py.

Member Function Documentation

def find_peaks (   self,
  data 
)

Find peaks in the data.

  • data list of floats that contains data within which we seek to find peaks

Makes a window and looks for the highest value within that window. If the highest value is at the boundary of the window, it is ignored; else the peak is saved. The index corresponding to window start is then incremented by one and the routine is repeated.

uses window_size that is the smallest of self.window_size and len(data)

Returns a list of indices, each index corresponding to the location of a peak

Definition at line 55 of file _window_peak_finder.py.

References WindowPeakFinder.threshold, WindowPeakFinder.window_size, and WindowPeakFinder.window_step.

Member Data Documentation

window_size

Definition at line 34 of file _window_peak_finder.py.

Referenced by WindowPeakFinder.find_peaks().

threshold

Definition at line 35 of file _window_peak_finder.py.

Referenced by WindowPeakFinder.find_peaks().

window_step

Definition at line 36 of file _window_peak_finder.py.

Referenced by WindowPeakFinder.find_peaks().


The documentation for this class was generated from the following file: