spikeinterface: ValueError: The sorting object has spikes exceeding the recording duration.
Hi, This error below is new and never happened before while trying to extract waveforms from sorted data. Below is the code: ``sorting_KS25 = ss.read_sorter_folder(base_folder/“results_KS25”) sorting_KS25 recording_saved = si.load_extractor(base_folder / “preprocessed”) sorting = sorting_KS25 print(sorting)
we = si.extract_waveforms(recording_saved, sorting, folder=base_folder / “waveforms”, allow_unfiltered=True, load_if_exists=False, overwrite=True, **job_kwargs) #Without allow_unfiltered=True it was giving error saying that waveforms are not filtered. This is because I did not run band pass filter earlier due to catGT output files already being bandpass filtered print(we)``
and I get the following error ;
ValueError: The sorting object has spikes exceeding the recording duration. You have to remove those spikes with the `spikeinterface.curation.remove_excess_spikes()` function
Not sure why this is. Also, how can no of spikes exceed recording duration. Not sure if I am not understanding it right but from the face value of it I am not sure how it is possible to have “excessive spikes” in a recording duration. First, I believe there’s no limit set on the source code to how many spikes are allowed in a recording duration and second, spike counts and duration are two different units that cannot be compared. Unless the error means that somehow after sorting the total duration of recording is coming out longer than the actual duration of the raw data? Which, again cannot possibly happen, unless this is a bug. Additionally, I searched for “remove_excess_spikes()” function in the documentation and was not successful in finding it. Will very much appreciate a solution to this. This did not happen with recordings of same length or longer from the same probe.
Thanks Jimmy
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 17 (6 by maintainers)
This could indicate a bug in the sortermaybe just to add more clarity. Otherwise people will come to the issue tracker and report the “bug” as a spikeinterface bug rather than as a sorter issue with the recording and sorting objects.But yeah I think you’re right that we are overloading terms. So your statement is clearer in that it is not the “spikes” which are the problems, but the “times”.
We might have forgotten to add it! Thanks for noticing, I’ll take a look at the docs!
Should we close this?