Hi all, I have been coding an experiment using the psychopy API to manage my display, present stimuli, etc. As I’m inexperienced with the API, I want to ask a couple of questions about RT measurement.
One: I want to confirm that my procedure will measure RT correctly. First I prepare the stimulus (or make a list of stimuli). Then I draw the stimulus(or list of stimuli), followed by a win.flip and an event.waitkeys. The RT is then the timestamp of the event.waitKeys minus core.getTime() right after the win.flip. Below is a sample take from my experiment code (and simplified to be self-contained):
Two: I am wondering whether my monitor refresh rate will have a large effect on my RT measurement from the start of the stimulus presentation to the response time. I am really most interested in this, a little bit of variability in the amount of time it takes for the stimulus to be initially presented isn’t a big deal as long as the RT measurement from that point onwards is good. As I understand it, the procedure I pasted above should get the initial time (t0) right after the win flip succeeds. Does that mean that my t0 will start from after the screen refresh, and thus my RT measurement will be relatively independent from refresh rate?
Thanks very much for your time and fantastic python package!
Rather than setting timeStamped = True, you should replace True with a clock object that you’ve zeroed immediately after the win.flip(). That way, the time stamp will automatically be counting from the appropriate zero point, and you don’t need to do any subtraction.
But in answer to your question, in your case, refresh rate is indeed irrelevant to your RT precision, as you are not checking for keypresses within a drawing loop. i.e. you draw the stimulus just once, leaving it static on screen while you wait for the next response, whenever it occurs. So your code is not suffering from the 16.7 ms granularity in response times that would occur if you checked once per 60 Hz screen refresh, say.
# initialize a clock at some point
myclock = core.Clock()
# reset the clock to 0 immediately after you flip the window
win.callOnFlip(myclock.reset)
win.flip()
# Wait for button press and get time compared to last reset of clock
resp = event.waitKeys(timeStamped=myclock)
I think I got that working now. For mine to work I had to use had to use core.Clock() not core.clock() and had to give win.callOnFlip trial_clock.reset without a () after the function name. Here it is in my actual code: