AllenNeuralDynamics / dynamic-foraging-task

Bonsai/Harp workflow for Dynamic Foraging with Python GUI for visualization and control
MIT License
5 stars 4 forks source link

Reset Harp timestamps when the task begins? #319

Open jsiegle opened 4 months ago

jsiegle commented 4 months ago

It would be ideal to send a timestamp reset command to the Synchronizer board when the task begins, so the timestamps don't grow indefinitely, and timestamps are relatively consistent across sessions. I'm not sure if the Synchronizer is currently hooked up to the behavior computer, so this may require a hardware change.

alexpiet commented 4 months ago

When do the timestamps reset now? Never?

One thing to keep in mind is the fiber photometry sessions have a 10 minute baseline period before trials start, so all timetamps for those sessions will be off by 10 minutes. I'm not sure what you have in mind by "relatively consistent"

jsiegle commented 4 months ago

Right now they only reset when the Synchronizer is power cycled, which only happens occasionally. So we are seeing timestamps in the millions. It would be helpful if the timestamps indicated the approximate time within the session, without having to shift them prior to analysis.

Does the behavior GUI also trigger fiber photometry acquisition? If so, it could reset timestamps when that begins, rather than at the start of the task.

alexpiet commented 4 months ago

Yes, the behavior GUI triggers fiber photometry acquisition.

I do not know how to reset the Synchronizer timestamps

jsiegle commented 4 months ago

You just need to send a Device.TimestampSecondsPayload message with a value of 0 to the ClockSynchronizer device:

image