Closedown

This commit is contained in:
x07maop
2015-06-23 14:56:36 +02:00
parent a2accf3a25
commit a08fb28b86

View File

@@ -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