From a08fb28b8618fdf201f0a3f45ccf6b48c74ec43a Mon Sep 17 00:00:00 2001 From: x07maop Date: Tue, 23 Jun 2015 14:56:36 +0200 Subject: [PATCH] Closedown --- script/EnergyScan.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/script/EnergyScan.py b/script/EnergyScan.py index a2f8e39..074d6bc 100644 --- a/script/EnergyScan.py +++ b/script/EnergyScan.py @@ -26,7 +26,7 @@ ALPHA=0 """ -print "\Starting energy scan - Parameters: ", +print "\nStarting energy scan - Parameters: ", print E1,E2,TIME,DELAY,MODE ,OFFSET ,FOLDER ,FILE ,ALPHA start = time.localtime() @@ -34,7 +34,7 @@ start = time.localtime() folder = os.path.expanduser("~/Data1/") + FOLDER + "/"; def getNewestFile(): try: - return max(glob.iglob(folder+'/*.tsxt'), key=os.path.getctime) + return max(glob.iglob(folder+'/*.txt'), key=os.path.getctime) except: return None newest = getNewestFile() @@ -44,6 +44,9 @@ def wait_channel(name, value, type): cawait(name, value, type = type) print "Done" + + + #Pre-actions #wait_channel('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's') caput('X07MA-ID:MODE', MODE) @@ -75,28 +78,20 @@ time.sleep(2.0) print "Finished Energy scan" - -#name = caget("MSG").split(' ')[0] -#name = folder + name; - - +#File convertion newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt"; +#name = caget("MSG").split(' ')[0] name = getNewestFile() - if name == newest: raise Exception("Data file not created") if not os.path.isfile(name): raise Exception("Data file not found: " + name) - -cmd = cmd + name + " " + newName; +cmd = "/sls/X07MA/data/x07maop/bin/modify_otf.pl " + name + " " + newName; print("Converting data file: " + cmd); import os os.system(cmd) print("Success") -#~/Data1/2015_06/20150623/23Jun_11_08_Fe_plus.txt -#~/Data1/2015_06/20150623/20150623_1144_Fe_plus_0000.txt -