int-brain-lab / iblrig

Main repository for IBL rig code
https://int-brain-lab.github.io/iblrig/
MIT License
22 stars 21 forks source link

Add information about state outputs to bpod data jsonable #721

Open oliche opened 1 month ago

oliche commented 1 month ago

When states output a TTL on the BNC outputs to synchronize external devices, the information about those TTLs being sent are not being captured. We have to infer by trial and error which states have been used for synchronisation when extracting the data.

In a future version of the bpod wrapper, this would be taken care of by the interface with bpod.

A shorter and faster development would be to patch the bpod_data dictionary we recover at the end of the trial with the information by adding to the Events timestamps dictionary the end times of states that sent out a TTL.

It would be a good opportunity to also make sure the bpod_data dictionaries have consistent keys, even in the absence of signal. To do this we would just add empty lists to the events and states dictionaries.