Skip to content

Conversation

@ecobost
Copy link
Contributor

@ecobost ecobost commented Feb 2, 2026

sd_ratio uses get_template_extremum_channel to select the "best_channel" for each unit. Similar to other metrics/extensions where this function is used (spike_amplitudes, spike_locations, template_metrics, snr) I think it's worth adding a peak_sign so people can control its behavior.

Effect is rather minimal because few extremum channels change and nearby channels have similar noise levels anyway but if spike_amplitudes were created with peak_sign='both', it is correct to use peak_sign='both' here too to select the same channel for the std(noise) (as was used for spike_amplitudes).

I also refactored some code for legibility but results are unchanged (for peak_sign='neg', the default).

@alejoe91 alejoe91 added the metrics Related to metrics module label Feb 3, 2026
Copy link
Collaborator

@yger yger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thanks a lot for the careful review of the metrics!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metrics Related to metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants