else: params = trials.trialList[0].keys() #save data for this loop trials.saveAsPickle(filename+'trials') trials.saveAsExcel(filename+'.xlsx', sheetName='trials', stimOut=params, dataOut=['n','all_mean','all_std', 'all_raw']) #Start of routine end t=0; endClock.reset() frameN=-1 #update component parameters for each repeat key_resp_3 = event.BuilderKeyResponse() #create an object of type KeyResponse key_resp_3.status=NOT_STARTED text_6.setText(run_num) rt.save(filename+'.npz',Feedbacks,Targets,Success) rt.close() def get_bars(arrow): S = Success[arrow] v = [] for i in xrange(int(len(S)/3)): v.append(sum(S[3*i:3*i+3])) print v return v downgraph = GraphBase(win,size=[0.75,0.5], pos=[0.2, 0],maxrange=[0,3]) upgraph = GraphBase(win,size=[0.75,0.5], pos=[-0.8,0],maxrange=[0,3]) upgraph.bar(get_bars('up'),abs_minmax=[0,100]) downgraph.bar(get_bars('down'),abs_minmax=[0,100]) upgraph.add_title('Successful Ups',0.075)
else: params = trials.trialList[0].keys() #save data for this loop trials.saveAsPickle(filename+'trials') trials.saveAsExcel(filename+'.xlsx', sheetName='trials', stimOut=params, dataOut=['n','all_mean','all_std', 'all_raw']) #Start of routine end t=0; endClock.reset() frameN=-1 #update component parameters for each repeat key_resp_3 = event.BuilderKeyResponse() #create an object of type KeyResponse key_resp_3.status=NOT_STARTED text_6.setText(run_num) rt.save(filename[:-5]+'_run_%s'%expInfo['session']+'.npz',Feedbacks,Targets,Success) rt.close() def get_bars(arrow): S = Success[arrow] v = [] for i in xrange(int(len(S)/3)): v.append(sum(S[3*i:3*i+3])) print v return v downgraph = GraphBase(win,size=[0.75,0.5], pos=[0.2, 0],maxrange=[0,3]) upgraph = GraphBase(win,size=[0.75,0.5], pos=[-0.8,0],maxrange=[0,3]) upgraph.bar(get_bars('up'),abs_minmax=[0,100]) downgraph.bar(get_bars('down'),abs_minmax=[0,100]) upgraph.add_title('Successful Ups',0.075)