AllenNeuralDynamics / aind-dynamic-foraging-data-utils

Tools for the analysis of behavior and neural data from the dynamic foraging task
MIT License
2 stars 0 forks source link

Absolute_time alignment error #49

Closed ZhixiaoSu closed 5 days ago

ZhixiaoSu commented 1 month ago

Describe the bug Absolute time in the dataframe was supposed to be aligned to go cue of first trial, but is now aligned to the start of the first trial. In behavior control, a trial starts with and ITI, followed by a no lick window and then go cue comes.

To Reproduce Steps to reproduce the behavior: Please check this line: https://github.com/AllenNeuralDynamics/aind-dynamic-foraging-data-utils/blob/main/src/aind_dynamic_foraging_data_utils/nwb_utils.py#L332

Expected behavior Time is aligned to first go cue.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

alexpiet commented 1 month ago

Oof! good catch. This is probably my fault. Lets double check to make sure we are aligning everything to the start of the first go cue, and not the start of the first trial (FIP, events, trials table)

rachelstephlee commented 1 month ago

I've tracked the line that got messed up:

    t0 = df_ses_trials.start_time[0]
    absolute_time = df_ses_trials['goCue_start_time'] - t0

Alex is actively fixing this via this PR: https://github.com/AllenNeuralDynamics/aind-dynamic-foraging-data-utils/pull/50

rachelstephlee commented 5 days ago

closed with https://github.com/AllenNeuralDynamics/aind-dynamic-foraging-data-utils/pull/50