def save_gamma(self): """ """ # Create the new monitor, set values and save newMon = T.Monitor(self.monitor_name, self.width, self.distance) newMon.setSizePix(self.size) newMon.setNotes(self.notes) newMon.setGammaGrid(self.calculate_gamma()) if 'calib_date' in self.__dict__.keys(): newMon.setCalibDate(self.calib_date) newMon.saveMon()
# Initialize our intermediary variables and open the text file fileobj = open(monitor['calib_file'], 'rU') csv_read = csv.reader(fileobj) input_levels = [] lums = {'R': [], 'G': [], 'B': [], 'lum': []} gamma_vals = lums.copy() # Read input levels and luminescence values from file for row in csv_read: input_levels.append(float(row[0])) lums['R'].append(float(row[1])) lums['G'].append(float(row[2])) lums['B'].append(float(row[3])) lums['lum'].append(float(row[4])) # Calculate the gamma grid based on given lums gammaGrid = [] for val in ['R', 'G', 'B', 'lum']: calculator = T.GammaCalculator(inputs=input_levels, lums=lums[val]) gamma_vals[val] = [calculator.a, calculator.b, calculator.gamma] gammaGrid.append(gamma_vals[val]) # print gammaGrid # Create the new monitor, set values and save newMon = T.Monitor(monitor['monitor_name'], monitor['width'], monitor['distance']) newMon.setSizePix(monitor['size']) newMon.setNotes(monitor['notes']) newMon.setGammaGrid(gammaGrid) newMon.setCalibDate() newMon.saveMon()
p = Params() app = wx.App() app.MainLoop() #p.set_by_gui() #automatic parameters for quick testing p.subject='CH' p.demo=False p.texture_dur = .15 calib.monitorFolder = './calibration/'# over-ride the usual setting of where # monitors are stored mon = calib.Monitor(p.monitor) #Get the monitor object and pass that as an #argument to win: #win = visual.Window(monitor=mon,units='deg',screen=p.screen_number, # fullscr=p.full_screen) f = start_data_file(p.subject) p.save(f) f = save_data(f,'trial','target_ecc','correct','odd_first','neutral','rt','eye_moved') size = p.elems_per_row * p.elem_spacing pre_x = np.linspace(-size/2., size/2., p.elems_per_row) pre_y = np.linspace(-p.elem_spacing, p.elem_spacing, 3) xx,yy = np.meshgrid(pre_x,pre_y)
f = start_data_file(params.subject, list_data_dir) #Start by saving in the parameter setting: params.save(f) #For now, assume that the target and the annulus are going to have the same #orientation: params.target_ori = params.annulus_ori # NOW, we set up the window, win #This initializes the window: #This is the folder where we keep the calibration data: calib.monitorFolder = './calibration/'# over-ride the usual setting of # # where monitors are store mon = calib.Monitor(params.monitor) #Get the monitor object and pass that # #as an argument to win: # #win = visual.Window(monitor=mon, # screen=params.screen, # fullscr=params.fullscreen, # units=params.display_units) win = visual.Window(fullscr= params.fullscreen, monitor=mon, units="deg",screen=params.screen) #Initialize all the instances of stimulus bits and pieces for reuse: #win = visual.Window(fullscr= params.fullscreen, monitor=params.monitor, units="deg",screen=params.screen) win.mouseVisible = False # Set up Stimulus Bank bank = StimulusBank(win,params) #Make a trial list: