Hi,
I have a small problem that I am struggling to solve when I am adapting a staircase I have written into an interleaved version with the multiStair Handler. In the previous staircase I had some code for a variable thisCondition, which I don’t seem to have ever defined myself so assume it was imported from somewhere? The following snippet worked fine for the single staircase, but in multiStairHandler I am getting error messages that thisCondition is not defined.
for thisCondition in stairs:
grating.setContrast(.5)
grating2.setContrast(.5)
Stim = 60 #number of frames the onset delayed stim will appear for. Notice it is constant
nondelayedStim = thisCondition #total number of advance frames the non-delayed stim will appear for. Expressed as whatever number the staircase spits out.
Please does anyone have any advice on a fix?
Here is a longer snippet of my interleaved stair code if this info helps:
#create staircases
stairs=[]
for thisStart in info['startPoints']:
#we need a COPY of the info for each staircase
#(or the changes here will be made to all the other staircases)
thisInfo = copy.copy(info)
#now add any specific info for this staircase
thisInfo['thisStart']=thisStart #we might want to keep track of this
thisStair = data.StairHandler(startVal=thisStart,
extraInfo=thisInfo,
nTrials=400, nUp=1, nDown=2,
minVal = round(threshframes-3), #maxVal=8,
stepSizes= [round(threshframes/4) , 1 ])
#stepSizes= [4,1])
stairs.append(thisStair)
for trialN in range(info['nTrials']):
shuffle(stairs) #this shuffles 'in place' (ie stairs itself is changed, nothing returned)
#then loop through our randomised order of staircases for this repeat
for thisStair in stairs:
thisIntensity = thisStair.next()
print 'start=%.2f, current=%.4f' %(thisStair.extraInfo['thisStart'], thisIntensity)
#---------------------
#run your trial and get an input
#---------------------
clock=core.Clock()
clock.reset()
stop = 0
endtime = 10*60 #ends after 10 minutes
for thisCondition in stairs:
grating.setContrast(.5)
grating2.setContrast(.5)
Stim = 60 #number of frames the onset delayed stim will appear for. Notice it is constant
nondelayedStim = thisCondition #total number of advance frames the non-delayed stim will appear for. Expressed as whatever number the staircase spits out.
list = [0,1]#Randomly choose which stim will be delayed
order = choice(list)
Thanks for your help,
Christina