AllenInstitute / ecephys_etl_pipelines

Pipelines and modules for processing extracellular electrophysiology data
Other
1 stars 2 forks source link

Design functionality to address variable monitor lag in sync file for VBN #8

Closed wbwakeman closed 3 years ago

wbwakeman commented 3 years ago

Corbett has identified an issue with variable monitor timing in the Visual Behavior Neuropixels sync file. Need to understand the issue and design a fix for it.

This will affect any function where we need to get timing information about monitor events.

Validation criteria:

njmei commented 3 years ago

Additional details per @corbennett

It seems that the monitor lag (time between vsync signal for a flip and when the display actually updates) can change over the course of a session. So my code, which basically just finds one monitor lag value and applies this to the vsyncs to get the times when the frames actually appeared, is insufficient. I know the visual coding pipeline used the photodiode signals and interpolated the actual frame times. I haven't tried running their code on our experiments yet, but I'm not optimistic it would work out of the box since we're concatenating multiple stimuli (there will be long gaps between diode transitions between stimuli, also camstim inserts a rapid toggle of the diode at the beginning of every stimulus).

The code for using photodiode signals to interpolate frame times for the Visual Coding Neuropixels (VCN) project can be found at: https://github.com/AllenInstitute/ecephys_etl_pipelines/blob/7c0f238bf1f834bf4883a96e327f25bb2ce8d2a9/src/ecephys_etl/data_extractors/ecephys_sync_dataset.py#L58

It may make sense to move the VCN extract_frame_times_from_photodiode() implementation into ecephys_etl_pipelines repository this will have the following benefits: 1) Allow person taking on ticket to familiarize themselves with existing implementation. 2) Allow for refactor/re-use opportunities when formulating the solution for the Visual Behavior Neuropixel (VBN) project.

Tasks:

djkapner commented 3 years ago

I have read the design, and @njmei has answered all of my questions and addressed all of my comments. LGTM.

danielsf commented 3 years ago

The design document looks fine to me

njmei commented 3 years ago

Design document for the issue in question: http://confluence.corp.alleninstitute.org/display/IT/Addressing+variable+monitor+lag+in+sync+data+for+Visual+Behavior+Neuropixels