user_slope = 1.0 new_interDH = float(dDH_fit[0][1])*(old_interDH*user_slope+user_intercept)+ float(dDH_fit[0][0]) new_slopeDH = float(dDH_fit[0][1]) * old_slopeDH * user_slope new_inter1816 = float(d1816_fit[0][1])*(old_inter1816*user_slope+user_intercept)+ float(d1816_fit[0][0]) new_slope1816 = float(d1816_fit[0][1]) * old_slope1816 * user_slope #Write the new computed values into the calibration file config.set("Data", "delta_18o_intercept", new_inter1816) config.set("Data", "delta_18o_slope", new_slope1816) config.set("Data", "delta_d_intercept", new_interDH) config.set("Data", "delta_d_slope", new_slopeDH) config.write() lines.append("\n\n\n*****Slope and Intercept values After Calibration*****") lines.append("\n\nSlope for 18_16 after calibration = %10s" % new_slope1816) lines.append("\nIntercept for 18_16 after calibration = %10s" % new_inter1816) lines.append("\nSlope for D_H after calibration = %10s" % new_slopeDH) lines.append("\nIntercept for D_H after calibration = %10s" % new_interDH) txtfile.writelines(lines) txtfile.close() else: tkMessageBox.showinfo(title="Saving Calibration factor", message="You selected Cancel option") print "\nCalibration complete...."