# ---- run 'sanity checks' ----- #if not RunPreCheck(setupfile).run_all(): sys.exit() #if not RunCalibCheck(setupfile).run_all(): sys.exit() # create the setup instance setup = SetMeUp(setupfile) calib = Calibration(setupfile) calib.AdjustCalibTable() param_cmd = "SELECT * FROM PARAMETERS" param = pd.read_sql(sql=param_cmd, con="sqlite:///{}/Calibration.db".format(setup.clbdirc)) lastState = param.loc[param.iteration == param.iteration.iloc[-1]] lastState.set_index('parameter', inplace=True) calib.df.update(lastState) calib.df.nextValue = calib.df.currentValue # update the iteration calib.iteration = int(lastState.iteration.iloc[0]) + 1 # now run the calibration calib() ## clean up logger.info('----- Calibration Complete -----') logger.info('moving logfile {} to directory {}'.format(logfile, clbdirc)) shutil.move(logfile, setup.clbdirc + '/' + logfile) # move the log file to the directory # make some plots or something .... #