Add option to use ref_channel_ids in global common reference#3139
Merged
alejoe91 merged 1 commit intoSpikeInterface:mainfrom Jul 8, 2024
Merged
Add option to use ref_channel_ids in global common reference#3139alejoe91 merged 1 commit intoSpikeInterface:mainfrom
alejoe91 merged 1 commit intoSpikeInterface:mainfrom
Conversation
alejoe91
added a commit
to alejoe91/spikeinterface
that referenced
this pull request
Jul 4, 2024
This was referenced Jul 4, 2024
h-mayorquin
approved these changes
Jul 4, 2024
Collaborator
h-mayorquin
left a comment
There was a problem hiding this comment.
OK, initially I felt that we were caving to adding yet another keyword for yet another specific case but after reading this I think you hit the jackpot.
This falls naturally in the semantics of ref_channel_ids, it involves minimal code changes and within the complexities of the interaction between groups and ref_channel_ids it is relatively easy to document and the explanation does not feel convoluted.
As an aside you can support exactly the use case in #2985 as a side effect of this.
Great!
|
|
||
| traces = recording.get_traces() | ||
| assert np.allclose(traces, rec_cmr.get_traces() + np.median(traces, axis=1, keepdims=True), atol=0.01) | ||
| assert np.allclose(traces, rec_cmr_ref.get_traces() + np.median(traces[:, :3], axis=1, keepdims=True), atol=0.01) |
Collaborator
There was a problem hiding this comment.
I had to run this to understand it but makes sense.
| def _generate_test_recording(): | ||
| recording = generate_recording(durations=[1.0], num_channels=4) | ||
| recording = recording.channel_slice(recording.channel_ids, np.array(["a", "b", "c", "d"])) | ||
| recording = recording.rename_channels(np.array(["a", "b", "c", "d"])) |
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.
Fixes #2985
Add the option to select a subset of channels when reference is
globalvia theref_channel_idsargument.