Пример #1
0
 def test_envelopeBeatAndRaisedCos(self):
     win = self.win
     size = numpy.array([2.0, 2.0]) * self.scaleFactor
     if win.units in ['norm', 'height']:
         sf = 5
     else:
         sf = 5.0 / size  #this will do the flipping and get exactly one cycle
     if win._haveShaders == True:  # can't draw envelope gratings without shaders so skip this test
         image = visual.EnvelopeGrating(win,
                                        carrier='sin',
                                        envelope='sin',
                                        size=size,
                                        sf=sf,
                                        mask='raisedCos',
                                        ori=-45,
                                        envsf=sf / 2,
                                        envori=45,
                                        envphase=90,
                                        beat=True,
                                        moddepth=0.5,
                                        contrast=0.5)
         image.draw()
         utils.compareScreenshot('beatandrcos_%s.png' % (self.contextName),
                                 win)
         win.flip()
         "{}".format(image)
Пример #2
0
    frameDur = 1.0 / 60.0  # could not measure, so guess

# Initialize components for Routine "trial"
trialClock = core.Clock()
env_grating = visual.EnvelopeGrating(win=win,
                                     name='env_grating',
                                     carrier='sin',
                                     mask=None,
                                     ori=0,
                                     pos=(0, 0),
                                     size=(0.5, 0.5),
                                     sf=1.0,
                                     phase=0.0,
                                     color=[1, 1, 1],
                                     colorSpace='rgb',
                                     opacity=1,
                                     contrast=0.5,
                                     texRes=128,
                                     envelope='sin',
                                     envori=0.0,
                                     envsf=1.0,
                                     envphase=0.0,
                                     power=1.0,
                                     moddepth=1.0,
                                     blendmode='avg',
                                     beat=False,
                                     interpolate=True,
                                     depth=0.0)
if sys.version[0] == '3' and np.min(win.gamma) == None:
    logging.warning(
        'Envelope grating in use with no gamma set. Unless you have hardware gamma correction the image will be distorted.'
    )