mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 01:53:31 +01:00
fixup Simu: add edge detection function
This commit is contained in:
parent
c149389c84
commit
73b7fcb601
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ def detect_edges(threshold, data, rising=True, falling=False):
|
||||||
https://stackoverflow.com/a/50365462
|
https://stackoverflow.com/a/50365462
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mask = np.full(len(data), False)
|
mask = np.full(len(data)-1, False)
|
||||||
|
|
||||||
if rising:
|
if rising:
|
||||||
mask |= (data[:-1] < threshold) & (data[1:] > threshold)
|
mask |= (data[:-1] < threshold) & (data[1:] > threshold)
|
||||||
|
|
Loading…
Reference in a new issue