Skip to content

Commit

Permalink
Extensions are for all spikes
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Jul 1, 2024
1 parent a3cc09b commit 3211df7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/spikeinterface/postprocessing/amplitude_scalings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ def _merge_extension_data(
new_data["collision_mask"] = self.data["collision_mask"]

if kept_indices is not None:
valid = kept_indices[self.sorting_analyzer.get_extension("random_spikes")._get_data()]
new_data["amplitude_scalings"] = new_data["amplitude_scalings"][valid]
new_data["amplitude_scalings"] = new_data["amplitude_scalings"][kept_indices]
if self.params["handle_collisions"]:
new_data["collision_mask"] = new_data["collision_mask"][valid]
new_data["collision_mask"] = new_data["collision_mask"][kept_indices]

return new_data

Expand Down
3 changes: 1 addition & 2 deletions src/spikeinterface/postprocessing/spike_amplitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ def _merge_extension_data(
new_data["amplitudes"] = self.data["amplitudes"]

if kept_indices is not None:
valid = kept_indices[self.sorting_analyzer.get_extension("random_spikes")._get_data()]
new_data["amplitudes"] = new_data["amplitudes"][valid]
new_data["amplitudes"] = new_data["amplitudes"][kept_indices]

return new_data

Expand Down
3 changes: 1 addition & 2 deletions src/spikeinterface/postprocessing/spike_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def _merge_extension_data(
):
new_spike_locations = self.data["spike_locations"]
if kept_indices is not None:
valid = kept_indices[self.sorting_analyzer.get_extension("random_spikes")._get_data()]
new_spike_locations = new_spike_locations[valid]
new_spike_locations = new_spike_locations[kept_indices]

### In theory here, we should recompute the locations since the peak positions
### in a merged could be different. Should be discussed
Expand Down

0 comments on commit 3211df7

Please sign in to comment.