From 6f0eadcc2a68f8338498493dbcd905ba87e9d335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Mon, 10 Jun 2024 17:32:00 +0200 Subject: [PATCH 1/2] Add `peak_to_peak` mode to SNR --- src/spikeinterface/qualitymetrics/misc_metrics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/qualitymetrics/misc_metrics.py b/src/spikeinterface/qualitymetrics/misc_metrics.py index f1082386cc..1e7d4d0444 100644 --- a/src/spikeinterface/qualitymetrics/misc_metrics.py +++ b/src/spikeinterface/qualitymetrics/misc_metrics.py @@ -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. @@ -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 From fcd6f8e274eab4648f91772d36000025d6b1f22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Wed, 12 Jun 2024 14:08:50 +0200 Subject: [PATCH 2/2] Update src/spikeinterface/qualitymetrics/misc_metrics.py Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/qualitymetrics/misc_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/qualitymetrics/misc_metrics.py b/src/spikeinterface/qualitymetrics/misc_metrics.py index 1e7d4d0444..cbb55aeb8b 100644 --- a/src/spikeinterface/qualitymetrics/misc_metrics.py +++ b/src/spikeinterface/qualitymetrics/misc_metrics.py @@ -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", "peak_to_peak", 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.