コード例 #1
0
#
# Ask the user to enter the squish value
#
squish = float(raw_input("Enter the squish value for the instrument: "))
config = CustomConfigObj('C:\Picarro\G2000\InstrConfig\Calibration\InstrCal\Beta2000_HotBoxCal.ini')

#
# Read the FSR value from the hotboxcal.ini
#
old_fsr = config.getfloat("AUTOCAL", "CAVITY_FSR", 0)

#
# Compute the Squish value and update the value in the hotboxcal.ini file
#
new_fsr = (1+squish)*old_fsr
config.set("AUTOCAL", "CAVITY_FSR", new_fsr)
config.write()

print "\nThe corrected Squish value is: " + str(new_fsr)

raw_input("\nPress Enter to Exit")






    


コード例 #2
0
    lines.append("\nIntercept for D_H before calibration = %10s" % old_interDH)


    user_intercept = 0.0
    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:
コード例 #3
0
pylab.xlabel('Measured value')
pylab.ylabel('Expected value')
pylab.title('CH4 Calibration')
pylab.draw()

# Save the matlab plot in the location specified by fname
fname = 'Z:\Standard Tests\HKDS\CH4_Calibration\CH4_cal'
pylab.savefig(fname, dpi=None, facecolor='w', edgecolor='w',
        orientation='portrait', papertype=None, format=None)
pylab.close()

#Save the slope and intercept in the N2 cal file
config = CustomConfigObj('C:\Picarro\G2000\InstrConfig\Calibration\InstrCal\InstrCal_LCT_N2.ini')
# Update the intercept value
config.getfloat("Data", "ch4_conc_intercept", 0)
config.set("Data", "ch4_conc_intercept", intercept)
config.write()
# Update the slope value
config.getfloat("Data", "ch4_conc_slope", 1)
config.set("Data", "ch4_conc_slope", slope)
config.write()

#Save the slope and intercept in the ZA cal file
config = CustomConfigObj('C:\Picarro\G2000\InstrConfig\Calibration\InstrCal\InstrCal_LCT_Air.ini')
# Update the intercept value
config.getfloat("Data", "ch4_conc_intercept", 0)
config.set("Data", "ch4_conc_intercept", intercept)
config.write()
# Update the slope value
config.getfloat("Data", "ch4_conc_slope", 1)
config.set("Data", "ch4_conc_slope", slope)