SpikeInterface / SpikeInterface/spikeinterface

Encountered divided by zero when using ''localize_peaks()"

Open
#2,682 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

motion correction
Dominant language
Python
Stars
847
Forks
280
Avg merge
3d 9h
Merged PRs (30d)
29

Description

Hello,

I was testing out DREDge with my recording but it seems to have some problem during peak localization step. It encounters some divided by zero problem. I checked the probe coordinates and device indices, both are good.

The warning message is:

RuntimeWarning: divide by zero encountered in divide
com = np.sum(wf_data[:, np.newaxis] * local_contact_locations, axis=0) / np.sum(wf_data)

My preparation of the recording:

recording_prep

Peak detection:

detect_peaks

Localization step (this is where the error comes from):

localization

Please let me know which direction to head towards to solve this. Thanks a lot!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing DREDge's peak-localization path into localize_peaks and reproduce the reported RuntimeWarning using the recording preparation and peak-detection setup shown in the issue. Inspect the inputs to the displayed NumPy calculation and determine what condition produces a zero denominator; done means localization handles that condition without the divide-by-zero warning and the reported workflow still completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.