Repository navigation
SpikeGLX: fix segment and event times ignoring firstSample - #1952
Open
h-mayorquin wants to merge 1 commit into
Open
h-mayorquin wants to merge 1 commit into
h-mayorquin wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1609 fixed the signal start times for #1607 but two other places still count from the start of each file instead of using
firstSample. The segment window runs from 0 to the duration of the longest stream, and the nidq digital events are timed from the first sample of the file. Onspikeglx/DigitalChannelTest_g0the nidq signal spans 11.90 to 174.61 s while the segment spans 0 to 162.71 s, and the firstXD0 ONcomes out at 0.0936 s instead of 11.9944 s.This PR starts each segment at its earliest stream, ends it at the latest stream stop, and adds the nidq start time to the event times. I extended
test_t_start_readingto check the start and stop of every segment of5-19-2022-CI4against values computed from the.metafiles, andtest_nidq_digital_channelto check the firstXD0 ONagainstfirstSampleand the sample of the first rising edge in the.bin. Both fail on master. This shifts the event times byfirstSample / niSampRate, so code that added that offset by hand should stop doing it.