# readme.md Please cite our paper if you use or modify this code. Burlingham, C.S. & Heeger, D.J. (2020). Heading perception depends on time-varying evolution of optic flow. PNAS. ## Usage /stimulus/ • run OFexpt_EM.m to run the envelope motion experiment. You will need to install MGL first: https://gru.stanford.edu/doku.php/mgl/download • run OFexpt_PM_Last.m to run the non-varying phase motion (last) experiment. • The code for every other experiment in the paper are included in this directory as well (including control experiments). /analysis/choiceData/ • run OFAnalysis.m to fit a psychometric function to choice data and extract heading bias and variability. • To recreate figs 4 and S1-3 run this function within a directory containing data (.mat) files, which are automatically outputted by MGL. • run OFAnalysis_controlExpts.m on data from the control experiments to recreate figs S5 and S7. /analysis/eyeData/ • run wsEyeAnal.m within a directory containing .mat (MGL choice data) and .edf (EyeLink gaze data) files to reproduce eye movement analyses detailed in the supplementary appendix. /Rieger&Lawton/ • run myRiegerLawton.m to recreate fig S6 in the SI. • myRiegerLawton.m estimates heading from the optic flow fields conveyed by the stimuli in our experiment, using the method of Rieger & Lawton (1985).