Size of the grating stimulus is not correct

Hello,
I want to show the moving grating stimulus the size of half of the screen at a time with gratings rotated at 90 degrees increments (0, 90, 180, and 270 degrees orientations).
The problem is that the size is correct only for horizontal gratings and not for vertical gratings. I tried both Psychopy versions 1.84.2 and 1.85 and the problem is the same. I am using Lubuntu linux 16.10.
Here are the screenshots of the problem:
Correct stimulus size of half the screen in horizontal orientation


This stimulus should take only half the screen on the right side, but it is shown fullscreen.

I use trialHandler to record trial conditions, here is the printout of the conditions list from the trialHandler:

[OrderedDict([('orientation', 90), ('position', (320, 0)), ('size', [640, 1024]), ('speed', 0)]), OrderedDict([('orientation', 90), ('position', (320, 0)), ('size', [640, 1024]), ('speed', 0.083)]), OrderedDict([('orientation', 0), ('position', (0, 256)), ('size', [1280, 512]), ('speed', 0)]), OrderedDict([('orientation', 0), ('position', (0, 256)), ('size', [1280, 512]), ('speed', 0.083)]), OrderedDict([('orientation', 270), ('position', (-320, 0)), ('size', [640, 1024]), ('speed', 0)]), OrderedDict([('orientation', 270), ('position', (-320, 0)), ('size', [640, 1024]), ('speed', 0.083)]), OrderedDict([('orientation', 180), ('position', (0, -256)), ('size', [1280, 512]), ('speed', 0)]), OrderedDict([('orientation', 180), ('position', (0, -256)), ('size', [1280, 512]), ('speed', 0.083)])]

I set the stimulus position, orientation, and size for each trial:

    for thisTrial in trials:
        wave.units = 'pix'
        wave.pos = thisTrial['position']
        wave.size = thisTrial['size']
        wave.units = 'deg'
        wave.ori = thisTrial['orientation']

and check the actual parameters after the stimulus is drawn:

            wave.phase += thisTrial['speed']
            if frameN % 119 == 0:
                print 'position: ', wave.pos, ', size: ', wave.size, ', orientation: ', wave.ori 

However, despite printing out the correct size when queried a stimulus is displayed full screen half of the time (screen size is 1280 x 1024):

position:  [ 320.    0.] , size:  [  640.  1024.] , orientation:  90
**position:  [   0.  256.] , size:  [ 1280.   512.] , orientation:  0**
position:  [-320.    0.] , size:  [  640.  1024.] , orientation:  270
**position:  [   0. -256.] , size:  [ 1280.   512.] , orientation:  180**

Horizontally oriented stimuli always have the correct size, but vertical stimuli are always drawn full screen. Asterisked stimuli are displayed correctly.
Please help me to solve this mystery!

You understand that width and height are essentially switched if you rotate your stimulus 90 degs, right?

1 Like

Thank you, Jon, I did not realise that. What prevented me from realising it is that the size out of bounds in one dimension also produced the full screen size in all dimensions with no error message or warning in the console.