Hello,
I am using the GratingStim on Coder (v2023.1.2) to create some plaid motion rivalry stimuli. I am playing around with key parameters to be able to create the optimal rivalry conditions I would like for my experiment (i.e. clear transitions between coherence and transparency). The only parameter I am failing to adjust is the width of the gratings. Does anyone know how I can adjust these, without changing the mask size nor the spatial frequency? I have tried changing the texture resolution but it also doesn’t help. Is the only way around this to create my own texture? Thanks! Here is my code (so far a simple version implemented from the demo):
from psychopy import visual, logging, event, core
from psychopy import sound, gui, visual, core, data
from psychopy.hardware import keyboard
from psychopy.iohub import launchHubServer
import time
import random
import serial
import os
import csv
screen_num = 1 # 0 for same computer screen, 1 for room screen
# create a window to draw in and setup room window
win = visual.Window(fullscr=True, screen=screen_num, allowGUI=False, blendMode='avg', useFBO=False, color='grey', colorSpace='rgb')
logging.console.setLevel(logging.DEBUG)
# Initialize some stimuli, note contrast, opacity, ori
grating1 = visual.GratingStim(win, tex="sqr", texRes=1024, mask="circle", color='lightgrey',
units='height', size=(0.6), sf=(4), ori = 30, autoLog=False)
grating2 = visual.GratingStim(win, tex="sqr", texRes=1024, mask="circle", color='lightgrey', opacity=0.5,
units='height', size=(0.6), sf=(4), ori = -30, autoLog=False)
fixation1 = visual.Circle(win, units='height', size=(0.1),
lineColor = 'grey', fillColor = 'grey', autoLog=False)
fixation2 = visual.Circle(win, units='height', size = 0.02,
lineColor = 'red', fillColor = 'red', autoLog=False)
trialClock = core.Clock()
t = 0
while not event.getKeys() and t < 40:
t = trialClock.getTime()
grating1.phase = -1.5 * t # drift at 1Hz
grating1.draw() # redraw it
grating2.phase = 1.5 * t # drift at 2Hz
grating2.draw() # redraw it
fixation1.draw()
fixation2.draw()
win.flip()
win.close()
core.quit()