You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug/Unexpected effect in global timestamp computation #21
In a recently acquired session, global timestamps are miscalculated, because the events are sorted by timestamp, but the sample_number is therefore shuffled. When the global timestamp function takes the iloc[0] and iloc[-1]sample_number, then these are not the first and last sample in the acquisition.
You can see already in the head of the events dataframe that the sorting of the sample_number is random:
When checking the synchronization event counts and sample differences between the synch channels, they match perfectly, just not according to the built-in function.
Note that with the negative timestamp values, the timestamps set to -1 as not synchronized are in the middle section of the events dataframe.
Sorry, I misread in the diff of the latest merge that the sorting of the events dataframe was changed, but this is not the case for BinaryRecording instances.
Activity
medengineer commentedon Jun 6, 2023
Hi,
This should be fixed in the latest release here:
https://pypi.org/project/open-ephys-python-tools/0.1.5/
larsrollik commentedon Jun 7, 2023
Thank you, yesterday's release seems to fix it.
larsrollik commentedon Jun 7, 2023
Sorry, I misread in the diff of the latest merge that the sorting of the events dataframe was changed, but this is not the case for BinaryRecording instances.
See
open-ephys-python-tools/src/open_ephys/analysis/formats/BinaryRecording.py
Lines 206 to 209 in e7a6656
The original issue remains in https://github.com/open-ephys/open-ephys-python-tools/releases/tag/v0.1.5
medengineer commentedon Jun 7, 2023
I see. Does changing timestamp to sample_number on line 207 above fix the issue on your end w/ version 0.1.5?
larsrollik commentedon Jun 9, 2023
I assume so. It's done like that for the
OpenEphysRecordingtype. But I have not written tests for it.open-ephys-python-tools/src/open_ephys/analysis/formats/OpenEphysRecording.py
Line 290 in e7a6656