python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

improves blackrock spikes in nev

Open ferchaure opened this issue 2 years ago • 3 comments

Hi, I tried to open a .nev file (2.3 version) and I found t2o bugs and fix them:

-The timestamps gives one element less that the amount of spikes. I follow that issue to the _seg_t_stops definition and how is used to create a slice. Before the highest element in the nev file was defined as the t_stops and used to slice... keeping the last element outside the range. I just add a sample before converting to time and the appending to _seg_t_stops

-It wasn't possible to load the waveforms. The reshape in _get_spike_raw_waveforms throw an error related to sizes mismatch. In a few words, it had to many bytes for the waveforms (in my case 96 when each waveform should have 92). I could increase the bytes for the reserved fields of the Spikes fields in the __nev_data_types ... but given that each channels has its own waveform_dtypes maybe it has to be resize for each case. For that reason I create that additional dt1 type, to remove the extra bytes knowing how many bytes should be there for the waveform.

Cheers, Fernando

ferchaure avatar Aug 13 '22 16:08 ferchaure

Hello @ferchaure! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-08-30 15:33:56 UTC

pep8speaks avatar Aug 13 '22 16:08 pep8speaks

The last commit edits the segment stop just to extract spikes times (adding a sample to let it work fine with the stop of a slice), it fixes the same without editing the _seg_t_stops attribute

ferchaure avatar Aug 30 '22 15:08 ferchaure

Decision was made during a Neo discussion to add a flag to the loader that can be used to select the alternate waveform loading.

mdenker avatar Feb 23 '24 15:02 mdenker