RDK Dot size in degrees (rather than pixels)?

OS: Win10
PsychoPy version: 2020.1.3
Standard Standalone? (y/n): Y

What are you trying to achieve?:
I’m trying to convert RDK-dot size from pixels to degrees so when my task is run on other computers/monitors (i.e. a participant’s computer) they appear the same size consistently. Under the builder/dot size option it only allows me to input a pixel unit. Other properties such as RDK field size are in degrees and scale appropriately across computers.

(This is the result on two different laptops with the same task)

Is there someway to do a pixel to degree conversion that gives me consistent dot sizes across different screens?

What did you try to make it work?:
I’ve entered the monitor info with the same viewing distance with their respective monitor width and resolution on different laptops. I assume that due to different monitor’s pixel-properties dot sizes appear differently. If there’s no easy way to do a conversion, I’m thinking of using a code snippet that lets me scale dot size based on the monitor’s information (i.e. pixel count and screen width) but not sure how I’d do this

Thanks in advance!

Hi, there are some functions built into PsychoPy that allow conversions like this:


e.g. import this function like this:

from psychopy.tools.monitorunittools import deg2pix

Then you can calculate a value in pixels corresponding to an angle on the local monitor (assuming you have called it win, and that it has a valid entry defined in the Monitor Centre, giving its size and distance):

dot_size = deg2pix(degrees = 0.1, monitor = win.monitor))

Thanks for your help Michael! In a code snippet under begin routine I’ve entered this:
My monitor is called ‘M’ and my RDK stimuli is ‘RDK_Prac’

RDK_Prac.dotSize  = deg2pix(degrees = 0.186, monitor ='M') 

But I get this error:

If I try monitor = M.monitor I get a: ‘NameError: name ‘M’ is not defined’
I’m not the best at coding so I’m probably missing something.


Please show the line where you create your visual.Window()

Under the coder view:

win = visual.Window(
    size=[1997, 1331], fullscr=True, screen=0, 
    winType='pyglet', allowGUI=False, allowStencil=False,
    monitor='M', color=[0.506,0.506,0.506], colorSpace='rgb',
    blendMode='avg', useFBO=True, 

OK, so your code should be like this, rather than trying to directly refer to the monitor name as 'M':

RDK_Prac.dotSize  = deg2pix(degrees = 0.186, monitor = win.monitor)

Thanks Michael, that’s fixed it!