ScaleScreen CC screen dimensions from pix to norm?

I recently added the ScreenScale ID:29564 to my study to standardize the screen dimensions for participants. I made a recent post about the screen being in pix messing up the phase rates of my stimuli and that once I recoded in norm it resolved itself.

I have the box set to 20cm using the ScreenScale, but it seems to put the new polygon (20x20cm experiment screen) dimensions in pix. Now since it is doing that it messes up the masks on my stimuli from circles to ovals. Any ideas on how to fix this? I will post some code to show the adjustments I made to ScreenScale. Thanks!

from psychopy import visual, core, event
winSize = win.size
x = polygon.size[1]/polygon.size[0]
size = (.1, .1*x)

xright = ((polygon.size[0])/win.size[0])
xleft = ((polygon.size[0])/win.size[0]) * -1
ybot = ((polygon.size[1])/win.size[1]) * -1
ytop = ((polygon.size[1])/win.size[1])

print(“xright” + str(xright))

print("polygon size: " + str(polygon.size))
print("polygon pos: " + str(polygon.pos))
print("polygon vertices: " + str(polygon.vertices))

My Screen Scale code should adapt based on the default units.


if win.units=='norm':
    dbase = .0001
    unittext=' norm units'
elif win.units=='pix':
    dbase = .1
    unittext=' pixels'
    dbase = .0001
    unittext=' height units'

I would assume this would also be the case in the Builder? For some reason when I check the window units after using ScreenScale it says the units are pixels, not norm which I thought I had it set too.

Awesome code btw!

I only use Builder (with added code components). Did you change the units in Experiment Settings?

You could try just replacing the above code with:

dbase = .0001
unittext=' norm units'

It got switched in the experiment setting to pixels :sweat_smile: Thanks!

But the random orientation I coded into the study is still making my circle stimuli ovals. Any ideas? I’ll post some code below. (oris = orientation)

Begin Routine:

oris.append(random.randrange(75, 105))

For some reason when I randomize the orientation they turn into discs or ovals, which is why I thought the pixels may have been messing things up. But now that its not when I hard code the orientation to 0 they are circles. Any ideas?


I doubt my screen scale algorithm will work with norm units and the orientation parameter. Can you use height units? Why are you wanting to rotate a circle?

I plan on manipulating multiple parameters of gratings that will slide back and forth (ie orientation going back and forth between 105 & 75 degrees) to create dynamic stimuli across multiple dimensions. Then having participants select distractors when a certain parameter goes outside of that range and becomes a target.

I know it’s a lot of coding, but I believe psychopy can handle it. I just need a standardized experimental window for participants for when people take this study remotely because of the pandemic.

You think that height units would avoid this problem using ScreenScale?

Thanks for your help!

Yes I think height should help

However, I don’t think gratings work online yet

sigh. Is there a way I can check?

And height def helped. Thanks!

It’s not :frowning: But its been over a year since that post, so the (but could be) has me a bit hopeful haha