Skip to content

Read the lower word of PLX timestamps as unsigned - #1904

Open
h-mayorquin wants to merge 1 commit into
NeuralEnsemble:masterfrom
h-mayorquin:fix_plexon_spike_bugs
Open

h-mayorquin wants to merge 1 commit into
NeuralEnsemble:masterfrom
h-mayorquin:fix_plexon_spike_bugs

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

This came up in a conversion to NWB that we are working on in neuroconv, where the spike times of a sorted PLX file come from PlexonRawIO. Some of the spike times in that file came out about 72 minutes earlier than Plexon's own MATLAB reader from their SDK gives for the same spikes.

What is happening is a decoding error. PLX data block timestamps are 40 bits, with the lower 32 bits in TimeStamp. PlexonRawIO reads that field as int32, but I checked the header in Plexon's SDK and the type there is unsigned. With int32, a timestamp whose lower word is at or above 2^31 comes out 2^32 ticks early. I ran into this with a file sorted in Offline Sorter that has a 1 MHz clock, where that happens after about 36 minutes; with uint32 the spike and event times match the file.

I am preparing new Plexon test data for gin that includes a stub of that file, and I will add a test that reads it once the data is merged.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant