From 10884eac22590f511238cff30769fe09906ee032 Mon Sep 17 00:00:00 2001 From: X11MA Date: Sun, 21 May 2017 05:20:41 +0200 Subject: [PATCH] Closedown --- config/devices.properties | 4 ++-- script/EnergyScan.py | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/config/devices.properties b/config/devices.properties index a424624..2e42d88 100644 --- a/config/devices.properties +++ b/config/devices.properties @@ -2,8 +2,8 @@ TRX=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRX.RBV|Read||true TRY=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRY.RBV|Read||true TRZ=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:TRZ.RBV|Read||true THT=ch.psi.pshell.epics.ChannelDouble|X11MA-VME-ES4:THT.RBV|Read||true -Temp=ch.psi.pshell.epics.ChannelDouble|X11MA-ES3-LSCI:TEMP.RBV|Read||true -FE=ch.psi.pshell.epics.ChannelDouble|X11MA-FE:DSAPER|Read||true +Temp=ch.psi.pshell.epics.ChannelDouble|X11MA-ES3-LSCI:TEMP_RBV|Read||true +#FE=ch.psi.pshell.epics.Slit|X11MA-FE:DSAPER|Read||true ES=ch.psi.pshell.epics.ChannelDouble|X11MA-OP2-SL:TRY.RBV|Read||true cff=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:rbkcff|Read||true Grating=ch.psi.pshell.epics.ChannelString|X11MA-PGM:grating|Read||true diff --git a/script/EnergyScan.py b/script/EnergyScan.py index 65a16a6..5cc34db 100644 --- a/script/EnergyScan.py +++ b/script/EnergyScan.py @@ -124,7 +124,7 @@ def _startPlot(type): pass print "Done Plotting" output_file_TEY = output_path+"TEY_"+file_prefix+"_" + suffix + ".dat" - TEYout = open(output_file_TEY, "a+") + TEYout = open(output_file_TEY, "w+") sTEY = sep.join(str(x) for x in TEY) #+ line_sep # MCP1.write("%s" + sep % i) sTEYout = sep + "rbkenergy" + sep + "ID1_en" + sep + "ID2_en" + sep + "TEY_norm" + sep + "Keithley1" + sep + "Keithley2" + sep + "Keithley3"+ sep + "Polarisation" sTEYout = sTEYout + line_sep + sTEY @@ -222,17 +222,13 @@ open_vg12() time.sleep(0.5) open_vg13() -Log = [] - for scan_no in range(number_of_scans): suffix = ("%03d" % fid) input_file = input_path + "o" + file_prefix + "_" + suffix + ".dat" # Log.append(scan_no+1) #Log.append(posX) - - - - + sep = "\t" + line_sep = "\r\n" caput(OTF_E1, E1) caput(OTF_E2, E2) caput(OTF_TIME, TIME) @@ -243,7 +239,7 @@ for scan_no in range(number_of_scans): wait_channel(OTF_DONE, 1, type = 'i') time.sleep(DELAY) time.sleep(2.0) - + T_start = Temp.getValue() startPlot(PLOT_TYPE) #Start the OTF scan #caput(OTF_START, 'GO') @@ -258,7 +254,7 @@ for scan_no in range(number_of_scans): otf_start.write(0) finally: stopPlot() - + T_end = Temp.getValue() time.sleep(5.0) #TODO: wait for file instead of sleep #Convert file @@ -269,14 +265,13 @@ for scan_no in range(number_of_scans): plot_file(output_file, file_prefix+"_" + suffix) #"Scan " + str(scan_no+1)) print "Finished scan " + str(scan_no+1) + " out of " + str(number_of_scans) - '''output_file_Log = output_path+"Log_"+file_prefix+".dat" + output_file_Log = output_path+"Log_"+file_prefix+".dat" Logout = open(output_file_Log, "a+") - #sLog = sep.join(str(x) for x in Log) - sLogout = sep + "Scan_number" + sep + file_prefix + "_" + suffix + sep + "ID1_en" + sep + "ID2_en" + sep + "TEY_norm" + sep + "Keithley1" + sep + "Keithley2" + sep + "Keithley3"+ sep + "Polarisation" - sTEYout = sTEYout + line_sep + sTEY - TEYout.write(sTEYout) - TEYout.close() - print "Log file updated"''' + sLogout = "Scan_number: "+file_prefix+"_"+suffix+line_sep+"Settings: "+Element+", "+str(E1)+"-"+str(E2)+", "+str(TIME)+" min, "+str(OFFSET1)+", "+str(OFFSET2)+", "+pol_str+", ES="+str(ES.getValue())+", PGM:"+Grating.getValue()+", cff="+str(cff.getValue())+line_sep+"Positions: X="+str(TRX.getValue())+", Y="+str(TRY.getValue())+", Z="+str(TRZ.getValue())+", THT="+str(THT.getValue())+line_sep+"Temperature at start of the scan: "+str(T_start)+" and at the end of the scan: "+str(T_end)+line_sep + sLogout = sLogout + "-------------------------------------------------------------------------------------------------------------"+line_sep + Logout.write(sLogout) + Logout.close() + print "Log file updated" if RUNTYPE in ["+/-", "LH/LV"]: if polswitch == 1: