AllenNeuralDynamics / AllenNeuralDynamics/Aind.Behavior.VrForaging

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

Open
#475 0 comments 0 reactions 1 assignee Claimed by @bruno-f-cruz View on GitHub
Dominant language
C#
Stars
3
Forks
0
Avg merge
6h 37m
Merged PRs (30d)
5

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.