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 摘要。