Skip to content

Commit

Permalink
Merge pull request #3015 from chrishalcrow/remove-extremum-from-locat…
Browse files Browse the repository at this point in the history
…ions-init

Remove get_template_extremum_channel from spikelocations init
  • Loading branch information
samuelgarcia authored Jun 21, 2024
2 parents e431bd6 + c1c0cb6 commit 9795d40
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/spikeinterface/postprocessing/spike_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ class ComputeSpikeLocations(AnalyzerExtension):
def __init__(self, sorting_analyzer):
AnalyzerExtension.__init__(self, sorting_analyzer)

extremum_channel_inds = get_template_extremum_channel(self.sorting_analyzer, outputs="index")
self.spikes = self.sorting_analyzer.sorting.to_spike_vector(extremum_channel_inds=extremum_channel_inds)

def _set_params(
self,
ms_before=0.5,
Expand Down Expand Up @@ -89,8 +86,9 @@ def _set_params(
def _select_extension_data(self, unit_ids):
old_unit_ids = self.sorting_analyzer.unit_ids
unit_inds = np.flatnonzero(np.isin(old_unit_ids, unit_ids))
spikes = self.sorting_analyzer.sorting.to_spike_vector()

spike_mask = np.isin(self.spikes["unit_index"], unit_inds)
spike_mask = np.isin(spikes["unit_index"], unit_inds)
new_spike_locations = self.data["spike_locations"][spike_mask]
return dict(spike_locations=new_spike_locations)

Expand Down

0 comments on commit 9795d40

Please sign in to comment.