From 0b72c8a508bf48c13ce10636342ba1ba6703eb6c Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 29 Feb 2024 15:25:10 +0100 Subject: [PATCH] fix: not interpolating reference label in synchronizer Block --- src/crappy/blocks/synchronizer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/crappy/blocks/synchronizer.py b/src/crappy/blocks/synchronizer.py index 42f1977d..a49c5405 100644 --- a/src/crappy/blocks/synchronizer.py +++ b/src/crappy/blocks/synchronizer.py @@ -159,7 +159,14 @@ def loop(self) -> None: # Building the dict of values to send for label, values in self._data.items(): - to_send[label] = list(np.interp(interp_times, values[0], values[1])) + + # Keeping the values of the reference label as they are + if label == self._ref_label: + to_send[label] = values[1, :] + # For all the other labels, performing interpolation + else: + to_send[label] = list(np.interp(interp_times, values[0], values[1])) + # Keeping the last data point before max_t to pass this information on last = values[:, values[0] <= max_t][:, -1] # Removing the used values from the buffer, except the last data point