Use `np.diff()` on last 16 samples instead of only last datum pair

epoch_indexing_and_dataviz_layer
Tyler Goodlet 2022-12-21 13:21:49 -05:00
parent 98de22a740
commit f30a48b82c
1 changed files with 4 additions and 1 deletions

View File

@ -285,7 +285,10 @@ class Viz(msgspec.Struct): # , frozen=True):
) -> float: ) -> float:
if self._index_step is None: if self._index_step is None:
index = self.shm.array[self.index_field] index = self.shm.array[self.index_field]
self._index_step = index[-1] - index[-2] self._index_step = max(
np.diff(index[-16:]).max(),
1,
)
return self._index_step return self._index_step