Add get_start_time, get_end_time, and get_last_spike_frame to BaseSorting#4525
Open
h-mayorquin wants to merge 1 commit intoSpikeInterface:mainfrom
Open
Add get_start_time, get_end_time, and get_last_spike_frame to BaseSorting#4525h-mayorquin wants to merge 1 commit intoSpikeInterface:mainfrom
get_start_time, get_end_time, and get_last_spike_frame to BaseSorting#4525h-mayorquin wants to merge 1 commit intoSpikeInterface:mainfrom
Conversation
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.
BaseSortinghas no public way to query the start or end time of a segment.BaseRecordinghas both (#3623). This PR addsget_start_timeandget_end_timetoBaseSorting, plus aget_last_spike_framehelper. With a registered recording,get_end_timereturns the recording's end time. Without one, it returns the time of the last spike in the segment (the best the sorting can do on its own).get_start_timereads_t_startdirectly in both cases.Adding these accessors however creates an ambiguity: some sorting extractors set
_t_starton their segments at init. For example, neo sorting extractors set_t_startfrom the signal stream (e.g. Neuralynx infers it here). If that sorting registers a recording that also starts at 100.0s,get_start_timewould need to decide which value to return.The decision here is that registering a recording is a statement that "these are the right timestamps" (see #4519). In consequence,
register_recordingnow copies the recording's start times into the sorting segments'_t_start. This replaces whatever the extractor had set at init, soget_start_timereturns consistent values.