| Reference | Downloads | Github

Negative timestamps inaccurate



Hello everybody,

I’m programming an MRI experiment in which subjects are instructed to respond only within a given time window. If they respond too early, the trial has to be excluded from MRI analysis but the response shall still be recorded and used for behavioral analysis.

To achieve this, I want to call event.clearEvents() when the stimulus display is flipped onto the screen but reset() the clock only later when the response window begins. Thereby, when calling event.getKeys(keyList=responseMap.keys(), timeStamped=clock), I was hoping to get negative timestamps for premature responses and positive for valid ones.
This works so far except that negative timestamps don’t seem to be in seconds but always at value -0.20something. I would expect that a response 1 second before clock.reset() results in a timestamp of -1 but this is clearly not the case. I used a metronome to tap a response key every half of a second (120 bpm) and this is what the timestamps looked like:


It seems like for negative timestamps t, I have to calculate something like (t + 0.204) * 1000 to convert it to seconds. But still then negative values are rather spaced by 400 ms than 500 ms (i.e. 150 bpm) while the spacing for positive values looks fine. Any idea why this happens?

Thank you in advance!


Oops. I found the solution: I used the imprecise version of core.wait :smiley:
Everything works as expected.