Skip to content
Snippets Groups Projects
Commit 3d1971cd authored by François  LAURENT's avatar François LAURENT
Browse files

cleaner implementation for larvatagger.jl#65

parent a22beaee
No related branches found
No related tags found
No related merge requests found
Pipeline #91680 passed
...@@ -48,7 +48,8 @@ def interpolate(times, spines, anchor, window_length, ...@@ -48,7 +48,8 @@ def interpolate(times, spines, anchor, window_length,
grid = range(istart, istop+1) grid = range(istart, istop+1)
series = [] series = []
for i in grid: for i in grid:
t = np.trunc((anchor + i * frame_interval) * 1e4) * 1e-4 t = np.around(anchor + i * frame_interval, 4)
# nextafter may be useless now that we use around instead of trunc
inext = np.flatnonzero(np.nextafter(t, 0) <= times)[0] inext = np.flatnonzero(np.nextafter(t, 0) <= times)[0]
tnext, xnext = times[inext], spines[inext] tnext, xnext = times[inext], spines[inext]
if tnext - t < 1e-4: if tnext - t < 1e-4:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment