Script execution

This commit is contained in:
gobbo_a
2017-05-04 18:12:57 +02:00
parent 8ef44432ff
commit b19ddecbcb

View File

@@ -9,7 +9,7 @@ BPM_SENSORS = [("x","X1"), ("y","Y1"), ("q","Q1")] #(logic name sufix, channel s
prefix = args[0] if is_panel else "S30CB09-DWSC440" #"SINDI01-DWSC090"
scan_type = args[1] if is_panel else WireScanner.WireX1
scan_range = args[2] if is_panel else [-200, 200, -200, 200]
cycles = args[3] if is_panel else 5
cycles = args[3] if is_panel else 3
velocity = args[4] if is_panel else 200
bpms = args[5] if is_panel else get_wire_scanners_bpms(prefix)
blms = args[6] if is_panel else get_wire_scanners_blms(prefix)
@@ -107,10 +107,12 @@ def do_background():
set_attribute(path, "Sigma", bkg_sigma)
def calculate():
global cycles, wire
global cycles, wire, blms
for i in range (cycles):
for blm in blms:
x =load_data(wire+"_" + ("%04d" % i+1) + blm )
for j in range(len(blms)):
path = wire+"_" + ("%04d" % (i+1)) + "/blm" + str(j+1)
print "Path = ", path
x =load_data(path)
print x
@@ -137,8 +139,7 @@ def do_scan(index):
try:
scanner.scan() #scanner.waitState(State.Busy, 60000) Not needed as stream filter will make the wait
st.getChild("scanning").waitValue(1.0, 10000)
mscan (st, [w_pos()] + st.getReadables(), -1, -1, take_initial = True, after_read = check_end_scan)
calculate()
mscan (st, [w_pos()] + st.getReadables(), -1, -1, take_initial = True, after_read = check_end_scan)
except:
if not scanner.isReady():
print "Aborting scan"
@@ -146,6 +147,7 @@ def do_scan(index):
if not scan_complete:
raise
finally:
calculate()
#TODO: Display average of cycles
#Combining data of multiple series