AllenNeuralDynamics / AllenNeuralDynamics/Aind.Behavior.VrForaging

Systematic increase in latency between OdorSite event and Harp odor-onset trigger for first trial of each session

未關閉
#475 0 則留言 0 個 reaction 已指派 1 人 已被 @bruno-f-cruz 認領 在 GitHub 檢視
主要語言
C#
星號
3
分支
0
平均合併
6 小時 37 分鐘
30 天內合併 PR
5

描述

When comparing the offset between the software triggered odor at the start of an OdorSite with the Hardware timestamp provided from Harpolfactometer, I am observing a systematic increase for the first site in a session.

Image

I have obtained the missmatch by iterating this snippet over 500 sessions that run between 11/19/2025 to 1/22/2026 for 12 mice and 9 rigs.

```
from aind_behavior_vr_foraging.data_contract import dataset as vr_foraging_dataset
from pathlib import Path

session_path = Path(r'Z:/stage/vr-foraging/data/806527/806527_2026-01-22T184208Z') # One exampple
dataset = vr_foraging_dataset(session_path)

dataset['Behavior']['SoftwareEvents']['ActiveSite'].load()
sites_travelled = dataset['Behavior']['SoftwareEvents']['ActiveSite'].data
reward_sites_travelled = sites_travelled[sites_travelled["data"].apply(lambda x: x["label"] == "RewardSite")]

dataset['Behavior']['HarpOlfactometer'].load()
odor_triggers = dataset['Behavior']['HarpOlfactometer'].data

odor_triggers[55].load()
triggers = odor_triggers[55].data['EndValve0']
odor_onset = triggers[triggers]
odor_offset = triggers[~triggers]

missmatch = odor_onset.index - reward_sites_travelled.timestamp
missmatch = missmatch.reset_index().drop('index', axis=1)
missmatch.index.name = 'total_sites'
missmatch.columns = ['mismatch']
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。