File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,16 +187,30 @@ def examples7(self):
187187 # Plot
188188 fp .plot_preprocessing ()
189189
190- """
191- [findpeaks] >Import [.\f indpeaks\data\2 dpeaks_image.png]
192- [findpeaks] >Finding peaks in 2d-array using topology method..
193- [findpeaks] >Resizing image to (300, 300).
194- [findpeaks] >Scaling image between [0-255] and to uint8
195- [findpeaks] >Conversion to gray image.
196- [findpeaks] >Denoising with [fastnl], window: [31].
197- [findpeaks] >Detect peaks using topology method with limit at None.
198- [findpeaks] >Fin.
199- """
190+ # Plot the top 15 peaks that are detected and examine the scores
191+ fp .results ['persistence' ][0 :5 ]
192+
193+ # Take the minimum score for the top peaks off the diagonal.
194+ limit = fp .results ['persistence' ][0 :5 ]['score' ].min ()
195+ # Plot
196+ fp .plot (limit = limit , figure_order = 'horizontal' )
197+ # Mesh plot
198+ fp .plot_mesh ()
199+
200+ def example9 (self ):
201+ # Import library
202+ from findpeaks import findpeaks
203+ # Initialize findpeaks with cearus method.
204+ # The default setting is that it only return peaks-vallyes with at least 5% difference. We can change this using params
205+ # fp = findpeaks(method='caerus', params={'minperc': 10, 'window': 50})
206+ fp = findpeaks (method = 'caerus' )
207+ # Import example data
208+ X = fp .import_example ('facebook' )
209+ # Fit
210+ results = fp .fit (X )
211+ # Make the plot
212+ fp .plot ()
213+
200214
201215class TestFINDPEAKS (unittest .TestCase ):
202216
You can’t perform that action at this time.
0 commit comments