PyGaze - documentation - defaults
The defaults contain a full set of default values for all classes. Defaults in PyGaze are easily recognized by their upper case names. A full list is provided below.
defaults
is imported by every library, after which an attempt will be made to import constants
. By adding a file called constants.py to the directory of an experiment, a user may adjust the 'local defaults' for that experiment. constants.py should work in the same fashion as defaults (i.e. using the same variable names, but with different values), but not every default value has to be included. An example:
example constants.py |
---|
# MAIN
DUMMYMODE = False LOGFILENAME = input("Participant name: ") LOGFILE = LOGFILENAME[:] # DISPLAY DISPTYPE = 'psychopy' DISPSIZE = (1024,768) SCREENSIZE = (39.9,29.9) # EYETRACKER TRACKERTYPE = 'eyelink' SACCVELTHRESH = 35 SACCACCTHRESH = 9500 |
contents
defaultsmain
display
sound
input
eyetracker
FRL
cursor
full source
defaults
Below, a name, value and description is provided for every default is provided. They are ordered by their general use in the other PyGaze libraries.
main
name | value | type | description |
---|---|---|---|
DUMMYMODE |
False |
bool | False for gaze contingent display, True for dummy mode |
LOGFILENAME |
'default' |
string | logfile name, without path or extension; used for both the PyGaze logfile and the EyeTracker logfile(s) |
LOGFILE |
LOGFILENAME[:] |
string | logfile location; adding a path is optional (default path is the directory of the script you're running) |
display
name | value | type | description |
---|---|---|---|
SCREENNR |
0 |
int | number of the screen used for displaying experiment (start counting at 0) |
DISPTYPE |
'psychopy' |
string | 'psychopy' to use PsychoPy, or 'pygame' to use PyGame for stimulus presentation (mind you: DISPTYPE is used in other libraries as well: lipinput's Keyboard and Mouse, and libgazecon's FRL, for example) |
DISPSIZE |
(1280,1024) |
tuple | display resolution in pixels |
SCREENSIZE |
(33.8,27.1) |
tuple | physical screen size in centimeters (NOTE: this might not seem important, but it kind of is when using PyGaze's event detection algorithms: the physical screen size and the resolution are used to recalculate degrees of visual angle to pixels) |
MOUSEVISIBLE |
False |
bool | mouse visibility |
BGC |
(125,125,125,255) |
tuple | background colour |
FGC |
(0,0,0,255) |
tuple | foreground colour |
sound
name | value | type | description |
---|---|---|---|
SOUNDOSCILLATOR |
'sine' |
string | the type of oscillation of the sound wave, may be 'sine', 'saw', 'square', or 'whitenoise' |
SOUNDFREQUENCY |
440 |
int | sound frequency in Herz |
SOUNDLENGTH |
100 |
int | sound duration time (in milliseconds) |
SOUNDATTACK |
0 |
int | the duraction (in milliseconds) of the fading in of the sound |
SOUNDDECAY |
5 |
int | the duraction (in milliseconds) of the fading out of the sound |
SOUNDBUFFERSIZE |
1024 |
int | should be a power of 2; increase if playback is choppy |
SOUNDSAMPLINGFREQUENCY |
48000 |
int | in Herz: the amount of samples per second |
SOUNDSAMPLESIZE |
-16 |
int | determines bit depth (negative is signed) |
SOUNDCHANNELS |
2 |
int | 1 for mono, 2 for stereo |
input
name | value | type | description |
---|---|---|---|
MOUSEBUTTONLIST |
None |
None or list | allowed mouse buttons: None for all mouse buttons, or a list of numbers for buttons of choice, e.g. [1,3] for buttons 1 and 3 (NOTE: usually 1=left mouse button, 2=scroll wheel click, 3=right mouse button) |
MOUSETIMEOUT |
None |
None or int | time before None is returned when no input is received: None for no timeout, or a value in milliseconds |
KEYLIST |
None |
None or list | allowed keys: None for all keys, or a list of keynames for keys of choice, e.g. ['space','9',':'] for space, 9 and ; keys |
KEYTIMEOUT |
1 |
None or int | time before None is returned when no input is received: None for no timeout, or a value in milliseconds |
JOYBUTTONLIST |
None |
None or list | allowed buttons on the joystick: None for all joystick buttons, or a list of button numbers for buttons of choice, e.g. [0,3] for buttons 0 and 3 (NOTE: start counting at 0!) |
JOYTIMEOUT |
None |
None or int | time before None is returned when no input is received: None for no timeout, or a value in milliseconds |
eyetracker
name | value | type | description |
---|---|---|---|
TRACKERTYPE |
'eyelink' |
string | |
SACCVELTHRESH |
35 |
int | saccade velocity threshold in degrees per second |
SACCACCTHRESH |
9500 |
int | saccade acceleration threshold in degrees per second |
SMIIP |
'127.0.0.1' |
string | internal IP address for communication via iViewX (NOTE: this is SMI only; value will be ignored by other eye-trackers) |
SMISENDPORT |
4444 |
int | port number for outgoing communication (NOTE: this is SMI only; value will be ignored by other eye-trackers) |
SMIRECEIVEPORT |
5555 |
int | port number for incomming communication (NOTE: this is SMI only; value will be ignored by other eye-trackers) |
FRL
name | value | type | description |
---|---|---|---|
FRLSIZE |
200 |
int | FRL diameter in pixels |
FRLDIST |
125 |
int | distance between gaze position and FRL center in pixels |
FRLTYPE |
'gauss' |
string | type of edge for the FRL; should be 'circle', 'gauss', 'ramp', or 'raisedCosine' |
FRLPOS |
'center' |
string or int or float | FRL position from the gaze position, either in degrees or one of the following strings: 'center', 'top', 'topright', 'right', 'bottomright', 'bottom', 'bottomleft', 'left', or 'topleft' |
cursor
name | value | type | description |
---|---|---|---|
CURSORTYPE |
'cross' |
string | type of cursor image, indicated by one of the following strings: 'rectangle', 'ellipse', 'plus' (+), 'cross' (X), 'arrow' |
CURSORSIZE |
20 |
int or tuple or list | size of the cursor in pixels, defined by either an integer value, or a tuple for width and height (w,h) |
CURSORCOLOUR |
(0,0,0,255) |
string or tuple | cursor colour, defined by a colour name (e.g. 'red'), a tuple RGB-triplet (e.g. (255, 255, 255) for white or (0,0,0) for black), or a RGBA-value (e.g. (255,0,0,255) for red) |
CURSORFILL |
True |
bool | True for filled cursor, False for non filled cursor |
CURSORPENWIDTH |
3 |
string or int or float | cursor edge thickness in pixels (only if cursor is not filled) |
full source
You can find the full source code for defaults.py on GitHub.