Skip to content

Commit

Permalink
not use unit_index
Browse files Browse the repository at this point in the history
Co-authored-by: Alessio Buccino <[email protected]>
  • Loading branch information
samuelgarcia and alejoe91 authored Jul 3, 2024
1 parent f66a3b2 commit aa314cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spikeinterface/qualitymetrics/misc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,10 +1085,10 @@ def compute_drift_metrics(
spikes_in_bin = spikes_in_segment[i0:i1]
spike_locations_in_bin = spike_locations_in_segment[i0:i1][direction]

for unit_index, unit_id in enumerate(unit_ids):
for i, unit_id in enumerate(unit_ids):
mask = spikes_in_bin["unit_index"] == sorting.id_to_index(unit_id)
if np.sum(mask) >= min_spikes_per_interval:
median_positions[unit_index, bin_index] = np.median(spike_locations_in_bin[mask])
median_positions[i, bin_index] = np.median(spike_locations_in_bin[mask])
if median_position_segments is None:
median_position_segments = median_positions
else:
Expand Down

0 comments on commit aa314cd

Please sign in to comment.