Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peak_to_peak mode to SNR #3009

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/spikeinterface/qualitymetrics/misc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def compute_snrs(
A SortingAnalyzer object.
peak_sign : "neg" | "pos" | "both", default: "neg"
The sign of the template to compute best channels.
peak_mode : "extremum" | "at_index", default: "extremum"
peak_mode : "extremum" | "at_index" | "peak_to_peak", default: "extremum"
How to compute the amplitude.
Extremum takes the maxima/minima
At_index takes the value at t=sorting_analyzer.nbefore.
Expand All @@ -210,7 +210,7 @@ def compute_snrs(
noise_levels = sorting_analyzer.get_extension("noise_levels").get_data()

assert peak_sign in ("neg", "pos", "both")
assert peak_mode in ("extremum", "at_index")
assert peak_mode in ("extremum", "at_index", "peak_to_peak")

if unit_ids is None:
unit_ids = sorting_analyzer.unit_ids
Expand Down