Skip to content

Commit 7ad635d

Browse files
committed
In cas of empty slice continue and set period to 0
1 parent c069878 commit 7ad635d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/py_eddy_tracker/observations/network.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,5 +2336,8 @@ def get_period_with_index(t, i0, i1):
23362336
"""
23372337
periods = np.empty(i0.size, t.dtype)
23382338
for i in range(i0.size):
2339+
if i1[i] == i0[i]:
2340+
periods[i] = 0
2341+
continue
23392342
periods[i] = t[i0[i] : i1[i]].ptp()
23402343
return periods

0 commit comments

Comments
 (0)