Skip to content
Snippets Groups Projects
Commit 2b80f007 authored by Raphael's avatar Raphael
Browse files

minor

parent 0f0676bd
Branches
Tags
No related merge requests found
...@@ -26,7 +26,7 @@ def compute_trajectory(times, time_gap): ...@@ -26,7 +26,7 @@ def compute_trajectory(times, time_gap):
def apply_func_on_window(dat, func, radius, on_edge='copy'): def apply_func_on_window(dat, func, radius, on_edge='copy'):
result = np.zeros(dat.shape) result = np.zeros(dat.shape)
if on_edge == 'copy': if on_edge == 'copy':
dat = np.concatenate([np.full(radius, dat[0]), dat, np.full(radius, dat[-1])]) dat = np.concatenate([np.repeat(dat[0], radius), dat, np.repeat(dat[-1], radius)])
for i in range(radius, dat.shape[0] - radius): for i in range(radius, dat.shape[0] - radius):
data = dat[i - radius:i + radius + 1] data = dat[i - radius:i + radius + 1]
result[i - radius] = func(data) result[i - radius] = func(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment