I went further and wrote this program:
# Imports
import math
from windowframepack import *
from psychopy import visual, core, monitors
import psychopy.event
import pyautogui
width, height= pyautogui.size()
from Parameters import *
# Set-up screen
mywin = visual.Window([608, 684],fullscr=True, color='white',
screen = 1, monitor = "DLP", useFBO = True)
framePacker = ProjectorFramePacker (mywin)
winmenu = visual.Window(size = (400,400), color='white',
screen = 0)
clock = core.Clock()
# Menu
message = visual.TextStim(winmenu, text='Would you like to:
\n\n- Display a looming stimuli at 30Hz (press 1) \n\n- Display a
looming stimuli at 60Hz (press 2) \n\n- Display a looming stimuli
at 250Hz (press 3) \n\n- Display a looming stimuli at 1000Hz
(press 4) \n\n- Exit (press e)', height=0.06, wrapWidth=800,
pos=(0,0), color='black')
message.setAutoDraw(True) # automatically draw every frame
winmenu.flip()
while psychopy.event.getKeys != 'e':
keys=psychopy.event.waitKeys()
if '5' in keys:
rate = mywin.getActualFrameRate(nIdentical=10,
nMaxFrames=100, nWarmUpFrames=10, threshold=1)
print(rate)
rate2 = winmenu.getActualFrameRate(nIdentical=10,
nMaxFrames=100, nWarmUpFrames=10, threshold=1)
print(rate2)
# Stimuli approaching
if '1' in keys:
x=xcorr
y=ycorr
stimuli = visual.Circle(mywin, units='pix', radius=0,
edges=e, pos=(x, y), lineColor='black', fillColor='black')
timer = core.Clock()
for FrameN in range(d):
z=minr+(2*
(maxr)*math.tan(math.exp(-1))/(FrameN+1))
stimuli.radius=z
stimuli.setAutoDraw(True)
mywin.flip()
y= timer.getTime()
print ('total time: ' + str(y) + ' sec to show ' + str(d))
core.wait(wa)
stimuli.setAutoDraw(False)
mywin.flip()
# Exit
if 'e' in keys:
mywin.close()
winmenu.close()
core.quit()
break
# Error
else:
message.setAutoDraw(True)
winmenu.flip()
My problem is double, when I asked for telling me the frequency of the screens, it says:
None
632.3788333909163
None
841.4918067730555
None
736.8432221274081
None
604.6643445011365
None
778.3691826490057
None
789.3315214315422
None
1042.8096294019476
None
When I did the visual stimuli, I got very variables responses:
total time: 2.4257541370006948 sec to show 200
total time: 2.3384845900000073 sec to show 200
total time: 2.2981673310005135 sec to show 200
total time: 2.813584258999981 sec to show 200
Any ideas about how to solve this?