You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.3 KiB
63 lines
1.3 KiB
from __future__ import division |
|
from __future__ import print_function |
|
|
|
import os |
|
import random |
|
import sys |
|
import traceback |
|
import subprocess |
|
import math |
|
import numpy |
|
|
|
# Necesssary to access psychopy paths |
|
import psychopy # noqa:F401 |
|
|
|
import eyelinker |
|
|
|
import SaccadePursuit |
|
|
|
def convert_color_value(color): |
|
"""Converts a list of 3 values from 0 to 255 to -1 to 1. |
|
|
|
Parameters: |
|
color -- A list of 3 ints between 0 and 255 to be converted. |
|
""" |
|
|
|
return [round(((n/127.5)-1), 2) for n in color] |
|
|
|
|
|
#myPR655 = PR655(5) |
|
#print(myPR655) |
|
#myPR655.getLum() |
|
#nm, power = myPR655.getLastSpectrum() |
|
|
|
#print(nm) |
|
#print(power) |
|
|
|
#phot = hardware.findPhotometer() |
|
#print(phot) |
|
#print(phot.measure()) |
|
#print(phot.getLum()) |
|
|
|
#bg_color = convert_color_value(bg_color) |
|
fg_color = convert_color_value([0,0,255]) |
|
|
|
monitor_px = [1440,900] |
|
window_screen = 1 |
|
|
|
experiment_monitor = psychopy.monitors.Monitor( |
|
'testMonitor', width=41, |
|
distance=74) |
|
experiment_monitor.setSizePix(monitor_px) |
|
|
|
experiment_window = psychopy.visual.Window(monitor_px, |
|
monitor=experiment_monitor, fullscr=True, color=fg_color, |
|
colorSpace='rgb', units='deg', allowGUI=False, screen=1) |
|
|
|
keys = psychopy.event.waitKeys() |
|
|
|
#backgroundRect = psychopy.visual.Rect( |
|
# experiment_window, fillColor=fg_color, units='norm', width=2, |
|
# height=2) |
|
#backgroundRect.draw() |
|
|
|
|