Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError, divide by zero in Extracting waveforms #60

Open
reinderdorman opened this issue Mar 28, 2019 · 2 comments
Open

ValueError, divide by zero in Extracting waveforms #60

reinderdorman opened this issue Mar 28, 2019 · 2 comments

Comments

@reinderdorman
Copy link

note: This appears to be a different error than issue #22 (different error, different line in the script it seems). tried a solution mentioned there but didn't work.

So for on one dataset I have I get the following error at the extracting waveform part:

Extracting waveforms : 0%| | 0/521 [00:00<?, ?it/s]/home/rdorman/miniconda3/envs/klusta/lib/python3.5/site-packages/klusta/traces/waveform.py:94: RuntimeWarning: divide by zero encountered in true_divide
return np.clip((x - tw) / (ts - tw), 0, 1)
/home/rdorman/miniconda3/envs/klusta/lib/python3.5/site-packages/klusta/traces/waveform.py:94: RuntimeWarning: invalid value encountered in true_divide
return np.clip((x - tw) / (ts - tw), 0, 1)
ValueError: cannot convert float NaN to integer

Seems clear, there appear to be something with nans and dividing by zero. But, similar recordings work just fine, and in all other ways this recording doesn't seem to be different (i.e. raw traces and MUA script all work fine, there are no nans in the data, and no other strange things to be seen).

In the waveforms.py, these variables tw and ts are weak threshold and strong threshold, respectively. These are 2 and 4 (same as in the clustering for all my other recordings). But, i'm not fluent in python so I might miss something here.

I'm kind of in the dark here. No idea why it happens with just one recording (which seems fine otherwise). Any comments or help are appreciated.

Cheers, RD

@reinderdorman
Copy link
Author

reinderdorman commented Apr 3, 2019

Error seems to have dissappears, the only thing I recall that happened in between was an update of the code. Haven't seen the error since. Will update should the error return

edit 9/4: error happends again, consequently on the same data

@ferchaure
Copy link

ferchaure commented Sep 10, 2020

I got the same error.

And it is hard to reproduce, it happens sometimes with some recordings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants