From 7f72fba29be00499b6513a9815d283ba8a0155b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Thu, 29 Feb 2024 11:35:33 +0100 Subject: [PATCH] Fixed `drift_times` --- src/MEArec/drift_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MEArec/drift_tools.py b/src/MEArec/drift_tools.py index 25e689b..f2ffae9 100644 --- a/src/MEArec/drift_tools.py +++ b/src/MEArec/drift_tools.py @@ -137,17 +137,17 @@ def generate_drift_dict_from_params( # triangle / sine frequency depends on the velocity freq = 1.0 / (2 * half_period) - times = np.arange(end_drift_index - start_drift_index) / drift_fs + drift_times = np.arange(end_drift_index - start_drift_index) / drift_fs if slow_drift_waveform == "triangluar": - triangle = np.abs(scipy.signal.sawtooth(2 * np.pi * freq * times + np.pi / 2)) + triangle = np.abs(scipy.signal.sawtooth(2 * np.pi * freq * drift_times + np.pi / 2)) triangle *= slow_drift_amplitude triangle -= slow_drift_amplitude / 2.0 drift_vector_um[start_drift_index:end_drift_index] = triangle drift_vector_um[end_drift_index:] = triangle[-1] elif slow_drift_waveform == "sine": - sine = np.cos(2 * np.pi * freq * times + np.pi / 2) + sine = np.cos(2 * np.pi * freq * drift_times + np.pi / 2) sine *= slow_drift_amplitude / 2.0 drift_vector_um[start_drift_index:end_drift_index] = sine