Skip to content

Commit

Permalink
distrib.findLocalMinima: skip peaks with less than 5 points
Browse files Browse the repository at this point in the history
- unlikely to contain additional minimum
  • Loading branch information
ibressler committed Jun 9, 2021
1 parent 45eb76b commit 712d590
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions distrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def findLocalMinima(peakRanges, xarr, yarr, doPlot=False, verbose=False):
plt.figure(figsize=(15,5))
for ip, (istart, iend) in enumerate(peakRanges):
if verbose: print((istart, iend), xarr[istart], xarr[iend])
if iend-istart < 5: # skip this, can't be fitted and no sub-peaks are likely
newRanges.append((istart, iend))
continue
while yarr[istart] <= 0. and istart < iend:
istart += 1 # exclude leading zero
while yarr[iend] <= 0. and istart < iend:
Expand Down

0 comments on commit 712d590

Please sign in to comment.