As a result, each edge (except the first) start one index too early and finish one index to early. cf:
peaksy[peakedges[i]:peakedges[i+1]].tolist()
Thus if for example the last y_value from the first edge is larger than all the y values in the second edge, it is detected as the peak from the second edge.
This would be the correct indices to slice the edges.
In detect_peaks() from peakdetection.py the edges are calculated as
As a result, each edge (except the first) start one index too early and finish one index to early. cf:
peaksy[peakedges[i]:peakedges[i+1]].tolist()
Thus if for example the last y_value from the first edge is larger than all the y values in the second edge, it is detected as the peak from the second edge. This would be the correct indices to slice the edges.