def onCalibTestBtn(self, event): # set the gamma and test calibration currentCal = self.currentMon.currentCalib['gammaGrid'] calibDlg = GammaDlg(self, self.currentMon) if calibDlg.ShowModal() != wx.ID_OK: calibDlg.Destroy() return 1 nPoints = int(calibDlg.ctrlNPoints.GetValue()) stimSize = unicodeToFloat(calibDlg.ctrlStimSize.GetValue()) useBits = calibDlg.ctrlUseBits.GetValue() calibDlg.Destroy() autoMode = calibDlg.methodChoiceBx.GetStringSelection() # lib starts at zero but here we allow 1 screen = int(calibDlg.ctrlScrN.GetValue()) - 1 lumLevels = monitors.DACrange(nPoints) # gamma=None causes the function to use monitor settings lumsPost = monitors.getLumSeries(photometer=self.photom, lumLevels=lumLevels, useBits=useBits, autoMode=autoMode, winSize=self.currentMon.getSizePix(), stimSize=stimSize, monitor=self.currentMon, gamma=None, screen=screen,) if len(lumsPost) > 1: self.currentMon.setLumsPost(lumsPost) # save for future self.currentMon.setLevelsPost(lumLevels) # save for future self.unSavedMonitor = True
def onCalibTestBtn(self,event): #set the gamma and test calibration currentCal = self.currentMon.currentCalib['gammaGrid'] calibDlg = GammaDlg(self, self.currentMon) if calibDlg.ShowModal()!=wx.ID_OK: calibDlg.Destroy() return 1 nPoints = int(calibDlg.ctrlNPoints.GetValue()) stimSize = unicodeToFloat(calibDlg.ctrlStimSize.GetValue()) useBits = calibDlg.ctrlUseBits.GetValue() calibDlg.Destroy() autoMode = calibDlg.methodChoiceBx.GetStringSelection() screen = int(calibDlg.ctrlScrN.GetValue())-1 #lib starts at zero but here we allow 1 lumLevels=monitors.DACrange(nPoints) lumsPost = monitors.getLumSeries(photometer=self.photom, lumLevels=lumLevels, useBits=useBits, autoMode=autoMode, winSize=self.currentMon.getSizePix(), stimSize=stimSize, monitor = self.currentMon, gamma=None,#causes the function to use monitor settings screen=screen, ) if len(lumsPost)>1: self.currentMon.setLumsPost(lumsPost)#save for future self.currentMon.setLevelsPost(lumLevels)#save for future self.unSavedMonitor=True
def onCalibGammaBtn(self, event): if NO_MEASUREMENTS: # recalculate from previous measure lumsPre = self.currentMon.getLumsPre() lumLevels = self.currentMon.getLevelsPre() else: # present a dialogue to get details for calibration calibDlg = GammaDlg(self, self.currentMon) if calibDlg.ShowModal() != wx.ID_OK: calibDlg.Destroy() return 1 nPoints = int(calibDlg.ctrlNPoints.GetValue()) stimSize = unicodeToFloat(calibDlg.ctrlStimSize.GetValue()) useBits = calibDlg.ctrlUseBits.GetValue() calibDlg.Destroy() autoMode = calibDlg.methodChoiceBx.GetStringSelection() # lib starts at zero but here we allow 1 screen = int(calibDlg.ctrlScrN.GetValue()) - 1 # run the calibration itself lumLevels = monitors.DACrange(nPoints) _size = self.currentMon.getSizePix() lumsPre = monitors.getLumSeries(photometer=self.photom, lumLevels=lumLevels, useBits=useBits, autoMode=autoMode, winSize=_size, stimSize=stimSize, monitor=self.currentMon, screen=screen) # allow user to type in values if autoMode == 'semi': inputDlg = GammaLumValsDlg(parent=self, levels=lumLevels) lumsPre = inputDlg.show() # will be [] if user cancels inputDlg.Destroy() # fit the gamma curves if lumsPre is None or len(lumsPre) > 1: self.onCopyCalib(1) # create a new dated calibration self.currentMon.setLumsPre(lumsPre) # save for future self.currentMon.setLevelsPre(lumLevels) # save for future self.btnPlotGamma.Enable(True) self.choiceLinearMethod.Enable() # do the fits self.doGammaFits(lumLevels, lumsPre) else: logging.warning('No lum values captured/entered')