AllenNeuralDynamics / AllenNeuralDynamics/Aind.Behavior.VrForaging

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

Đang mở
#475 0 bình luận 0 reaction 1 người được giao Được @bruno-f-cruz nhận Xem trên GitHub
Ngôn ngữ chính
C#
Star
3
Fork
0
Merge trung bình
6 giờ 37 phút
Pull request đã merge (30 ngày)
5

Mô tả

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']
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.