Repository navigation
Count overlapping periods once in compute_total_samples_per_unit - #4941
Open
grahamfindlay wants to merge 1 commit into
Open
grahamfindlay wants to merge 1 commit into
grahamfindlay wants to merge 1 commit into
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.
If a unit's periods overlap,
compute_total_samples_per_unitdouble-counts the overlapping samples.Incorrect duration estimates obtained this way were being used by
firing_rate,presence_ratio,isi_violation,rp_violation,sliding_rp_violation,firing_rangeandamplitude_cv.For example, with respect to
firing-rate: Even though selecting the unit's spikes using overlapping periods withselect_sorting_periods_maskcorrectly counts each spike once, the duration estimate obtained using those periods is wrong, so the firing rates returned are too low.Simple fix is to use the union of each unit's periods in each segment, just like selecting its spikes already does.