Hi,
I have a very minimal code example here for grating stim. This code sets the units to degrees and then displays a 10 degree-wide gabor patch for 3 seconds. Apolgies to anybody that runs the code but must adjust these settings for ease of visibility.
I need to control the standard deviation of the gaussian mask, but I'm confused about how this standard deviation behaves. The below code has a stimulus size of 10 degrees, and the mask has an sd of 1. Therefore, my expectation is that the central 2 degrees of the 10 degree patch would have relatively high, though progressively lower, contrast, and the contrast of the outer degrees would then rapidly decrease.The stimulus would then have 0 contrast well before the borders of the patch. However, what I actually see when I run this code appears to be a full square patch convolved with a slightly-opaque mask over it, something like a Gaussian with a *very* wide sd.
When I play with the sd parameter, it also behaves in a way that I do not expect. Increasing the sd makes the gabor appear smaller - almost as if the gaussian mask is actually getting narrower (with a smaller sd). Decreasing the sd has the opposite effect.
I'm confused by this behavior. What is the sd parameter doing here, and if I want a gabor patch with 2 degrees of good visibility (and a Gaussian drop-off afterwards) as described above, how would I go about doing this?
__________________________________________________________________________
from __future__ import division
from psychopy import visual
from psychopy import core, monitors
Mon = monitors.Monitor('NewExperiment', width = 31, distance = 100)
Mon.setSizePix((1024, 768))
patchColor = 255
groundColor = 255/2
mywin = visual.Window(size = [1024, 768], fullscr = False, color = groundColor, colorSpace = 'rgb255', units = 'deg',
monitor = Mon, allowStencil = True)
gabor = visual.GratingStim(mywin, tex='sin', mask= 'gauss', units='deg',
pos=(0, 0), size=10, sf=2, ori=90,
phase=(0.0, 0.0), color=patchColor,
colorSpace='rgb255', contrast=1, maskParams = {'sd': 1})
gabor.draw(mywin)
mywin.flip()
core.wait(3)
core.quit()
__________________________________________________