-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute display lag in BehaviorOphysLimsApi #1400
Conversation
Previously the BehaviorOphysLimsApi did not compute monitor delay, but added a default value of 0.351. This updates the default to 0.215, which is the average of monitor delay for a large number of recent datasets. Additionally use the OphysTimeAligner methods to compute the display lag, which is used in the OphysTimeSync job to produce corrected timestamps in the LIMS pipeline.
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
Codecov Report
@@ Coverage Diff @@
## rc/1.6.0 #1400 +/- ##
============================================
+ Coverage 34.59% 34.71% +0.12%
============================================
Files 342 342
Lines 33248 33250 +2
============================================
+ Hits 11501 11542 +41
+ Misses 21747 21708 -39
Continue to review full report at Codecov.
|
@@ -15,7 +15,7 @@ | |||
REG_PHOTODIODE_MAX = 2.1 # seconds | |||
PHOTODIODE_ANOMALY_THRESHOLD = 0.5 # seconds | |||
LONG_STIM_THRESHOLD = 0.2 # seconds | |||
ASSUMED_DELAY = 0.0351 # seconds | |||
ASSUMED_DELAY = 0.0215 # seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm cautiously confident that this value is better than 0.0351 based on some analysis Wayne and I did. However, there should be a mechanism in place to re-evaluate this every so often as we collect more data to make sure this is still a reasonable value.
@@ -38,8 +39,10 @@ def get_sync_data(self): | |||
|
|||
@memoize | |||
def get_stimulus_timestamps(self): | |||
monitor_delay = .0351 | |||
return self.get_sync_data()['stimulus_times_no_delay'] + monitor_delay | |||
sync_path = self.get_sync_file() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
Response to #900
I updated the default value for monitor delay from .0351 to .0215, per the output of the ophys time sync jobs.
I also used the OphysTimeAligner class to compute the monitor delay, which is used by the ophys time sync job. This will throw a warning if the monitor delay falls outside of our "expected" parameters, but will still use the default value.
Looking for some feedback. Should we throw an error instead of a warning? What about the ophys time sync job?Edit: we should investigate this, but can be done outside of this story.I did some investigation and found that the stimulus timestamps were not being treated in a rig specific way (I was thinking of the ophys timestamps). So the 2p2 rigs either have a longer monitor delay for whatever reason than our other rigs, or there is some other issue causing the delay to be computed incorrectly.