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

Add rwd delay to nwb (test PR) #452

Closed ZhixiaoSu closed 2 months ago

ZhixiaoSu commented 2 months ago

The nwb file can be a bit misleading when the session has a 'reward delay', which is a fixed delay between response and reward.

In current version, 'reward_outome_time' is the time when reward is determined. If a choice is made, it's time of first lick, if not, it's time of end of lick window. It makes sense in sessions where there's no reward delay. But when we introduce a reward delay, this time should be called 'response_time' or 'decision_time' and additional 'reward_delay' information (not saved in nwb yet) should be added to calculate time of outcome.

Given how big impact this file may have downstream, minimum change is made here to enable analysis. One column called 'reward_delay' was added to NWB.

Btw, one questions about our current behavior pipeline: if we update the generate nwb function, do previous sessions get re-processed?

ZhixiaoSu commented 2 months ago

Re-do starting from develop branch.