# 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)

print(win.units)
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.

See

``````if win.units=='norm':
x_scale=.05
y_scale=.1
dbase = .0001
unittext=' norm units'
vsize=2
elif win.units=='pix':
x_scale=60
y_scale=40
dbase = .1
unittext=' pixels'
vsize=win.size[1]
else:
x_scale=.05
y_scale=.05
dbase = .0001
unittext=' height units'
vsize=1
``````

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:

``````x_scale=.05
y_scale=.1
dbase = .0001
unittext=' norm units'
vsize=2
``````

It got switched in the experiment setting to pixels 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))
oris.append(0)
degree_speeds.append(1)

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?

Thanks!

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?