If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): MacOS Sequoia
PsychoPy version (e.g. 2024.2.4 Py 3.8): V2024.2.4.
Standard Standalone Installation? (y)
URL of experiment:
Do you want it to also run locally? (N)
What are you trying to achieve?:
My stimulus is always being presented for a frame shorter than they should be.
I am unsure if this is due to inaccuracies in recording the onset and offset time of my stimulus (4 Image Components and 1 polygon component). For all image components, in the data tab I have the “Save onset/offset times” box selected, but the onset and offset times are not automatically recorded.
What did you try to make it work?:
I was able to record all the onset times using:
thisExp.addData(‘Image1_onset’, Image1.tStart)
To record offset times, when autoDraw is turned to null, I record the time when this occurs (see code below). Also, as an auxiliary method to measure stimulus duration, I record the number of frames where autoDraw = True.
# Begin Routine tab
mo_numFrame = 0
MO_off = []
store_MO_Off = False
# Each frame tab
if mask_one.autoDraw:
mo_numFrame = mo_numFrame + 1
store_MO_Off = True
else:
if store_MO_Off:
if len(MO_off) == 0:
MO_off.append(t)
store_MO_Off = False
However, both the number of frames recorded and the offset time, suggest that stimulus are being presented for 1 frame too short. For example, when I request 100ms, at a frame rate of 60hz, the stimulus are only on the screen for 5 frames. If I look at the time when autoDraw is no longer True, it shows the same pattern, with autoDraw being turned to Null after approximately 83ms. Inspection of log files confirmed this pattern.
I have a mask presented 100ms after image onset. Interestingly, if I compare the Image’s onset time to the onset time of the Mask, they are exactly 100ms apart, on almost all trials. Suggesting, the image is being displayed for 100ms.
This brings me to my questions, 1) is my stimulus timing off**, 2)** what is the optimal and most accurate for measuring stimulus duration and stimulus offset online?
Thanks in advance for any assistance any one can provide! ![]()