Skip to content

Commit

Permalink
use templates is_scaled
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed May 14, 2024
1 parent e863b88 commit 20bf14d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/spikeinterface/core/template_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def get_template_extremum_channel(
channel_ids = templates_or_sorting_analyzer.channel_ids

# if SortingAnalyzer need to use global SortingAnalyzer return_scaled otherwise
# we just use the previous default of return_scaled=True (for templates)
# we use the Templates is_scaled
if isinstance(templates_or_sorting_analyzer, SortingAnalyzer):
return_scaled = templates_or_sorting_analyzer.return_scaled
else:
return_scaled = True
return_scaled = templates_or_sorting_analyzer.is_scaled

peak_values = get_template_amplitudes(
templates_or_sorting_analyzer, peak_sign=peak_sign, mode=mode, return_scaled=return_scaled
Expand Down Expand Up @@ -196,12 +196,12 @@ def get_template_extremum_channel_peak_shift(templates_or_sorting_analyzer, peak

shifts = {}

# We need to use the SortingAnalyzer return_scaled if possible
# otherwise for Templates default to True
# We need to use the SortingAnalyzer return_scaled
# We need to use the Templates is_scaled
if isinstance(templates_or_sorting_analyzer, SortingAnalyzer):
return_scaled = templates_or_sorting_analyzer.return_scaled
else:
return_scaled = True
return_scaled = templates_or_sorting_analyzer.is_scaled

templates_array = get_dense_templates_array(templates_or_sorting_analyzer, return_scaled=return_scaled)

Expand Down Expand Up @@ -257,7 +257,7 @@ def get_template_extremum_amplitude(
if isinstance(templates_or_sorting_analyzer, SortingAnalyzer):
return_scaled = templates_or_sorting_analyzer.return_scaled
else:
return_scaled = True
return_scaled = templates_or_sorting_analyzer.is_scaled

extremum_amplitudes = get_template_amplitudes(
templates_or_sorting_analyzer, peak_sign=peak_sign, mode=mode, return_scaled=return_scaled
Expand Down

0 comments on commit 20bf14d

Please sign in to comment.