Skip to content

Commit

Permalink
fix: not interpolating reference label in synchronizer Block
Browse files Browse the repository at this point in the history
  • Loading branch information
WeisLeDocto committed Feb 29, 2024
1 parent 595df27 commit 0b72c8a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/crappy/blocks/synchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b72c8a

Please sign in to comment.