RT timing discrepancies between log file and csv file

**OS: MacOS Catalina
**PsychoPy version: v2021.1.2
**Standard Standalone? yes
**What are you trying to achieve?: I’m running a builder task in an fMRI study for which I need good keyboard response timings. Although the timings for the stimuli onsets line-up across the .csv and .log files, I am getting different times for when the keyboard response occurs across the two. Specifically I am looking at the timings for DATA Keypress in the log file, and the timings when adding the resp.rt to the resp.onset in the csv files. I don’t know why these inconsistencies exist in the first place but they are up to 200ms difference so it’s not just a matter of frames.

What did you try to make it work?:
-checking and unchecking the ‘Sync timing with screen’ in the keyboard response component
-experimenting with the order of the response component in routine

What specifically went wrong when you tried that?:
-Neither change was able to eliminate the variability in the RTs across the two files. Notably the reaction times aren’t consistently different – sometimes they are the same across the files, but there also seems to be a peak in the histogram at about 125ms difference. See attached histograms of two separate subjects.


Hi There,

Would you please be able to share a LOG file and a data file?

Thanks!
Becca

Hi Becca,

Sorry for the delay and thanks for getting back. Attaching the csv file but I can’t upload the log file exactly as is (the only authorized extensions are: jpg, jpeg, png, gif, ico, icns, py, psyexp, csv, xlsx, wav, mov, mp4). So I’ve uploaded it here as a .xlsx file.

Some things to note are:

The way the task works is that after option onset (where they see the values of the three options), there is 2s where they can view the options but not respond (basically so we can separate motor response from evaluation). Then they can press ‘1’, ‘2’,’ or ‘3’, to select one of the three options presented on screen. Anything that is recorded as keypress ‘5’ is a scanner pulse. I’m also attaching the python file used to parse it and the original .psyexp experiment.

Many thanks again for your help!

parse_logfile.py (2.6 KB)

sub23_logfile.xlsx (1.2 MB)

subTask_MRI.psyexp (1.1 MB)

sub_23.csv (915.3 KB)