LorenFrankLab / trodes_to_nwb

Converts data from SpikeGadgets to the NWB Data Format
MIT License
2 stars 2 forks source link

Restrict lookup of non-ptp position timestampt to specific epoch #80

Closed samuelbray32 closed 4 months ago

samuelbray32 commented 4 months ago

Issue In some experimental files trodes timestamps are not monotonic and unique between epochs even though they are within each epoch. One case that causes such is a user restart of trodes softwares between epoch recordings.

Improvement When looking up the position time using sample count, first restrict the digitize search to the epoch of interest using the sys_clock available in the rec_dci_timestamps

edeno commented 4 months ago

I believe the trodes timestamps are int32 and overflow periodically.

samuelbray32 commented 4 months ago

Yeah, most cases of that are fixed by #59. That fix works as long as the trodes timestamps remain unique. However, I have a couple cases where they aren't unique between epochs, even though they are unique within the epoch.

Since we know what epoch the position data is for we should be able to restrict the search being done by the digitize function more and make it work