From bba7de7c42376c32c034a63087aa947be6a8334a Mon Sep 17 00:00:00 2001 From: panepucci Date: Tue, 1 Dec 2015 10:05:55 +0100 Subject: [PATCH] Closedown --- script/fbm.py | 2 +- script/local.py | 4 ++++ script/rock.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/script/fbm.py b/script/fbm.py index 2e3526e..872cfe9 100644 --- a/script/fbm.py +++ b/script/fbm.py @@ -48,7 +48,7 @@ by = bpm1.read() print "EBOX-POSV before rock: " + str(by) # if beam is not off, do nothing if abs(by) > ymax: - rock() + run("rock", {"rock_axis":th1}) # result of ROCK time.sleep(2.0) diff --git a/script/local.py b/script/local.py index dec4048..d8a41ff 100644 --- a/script/local.py +++ b/script/local.py @@ -58,3 +58,7 @@ def fit(ydata, xdata = None): return (None, None, None) #fit([1,2,3, 3,3,3,4,5,6,12,33,23,15,3,2,1, 1, 1, 1, 1]) + + +def rock(axis = th1): + run("rock", {"rock_axis":th1}) \ No newline at end of file diff --git a/script/rock.py b/script/rock.py index 3dc2fc0..52a336b 100644 --- a/script/rock.py +++ b/script/rock.py @@ -19,7 +19,7 @@ def rock(axis = th1, ffail = False, tt = 0.2, seti0 = False, dx = None, noref = time.sleep(0.2) caput('X06DA-OP-MO1:ROX1.RDBD',0.00004) caput('X06DA-OP-MO1:ROX2.RDBD',0.00004) - caputT('X06DA-OP-MO1:ROX1.RTRY',5) + caput('X06DA-OP-MO1:ROX1.RTRY',5) caput('X06DA-OP-MO1:ROX2.RTRY',5) #time stamp @@ -29,7 +29,7 @@ def rock(axis = th1, ffail = False, tt = 0.2, seti0 = False, dx = None, noref = #SCAN,axis,0,2*dx,20,/fit,/centre,SILENT = silent,FFAIL = ffail,time=tt,/deriv,$ #data=d axis_pos = axis.read() - lscan(axis, beam_ref, -dx, dx, 20, latency = 0.3, relative = True, context = None, before_read = None, after_read = None) + result = lscan(axis, beam_ref, -dx, dx, 20, latency = 0.3, relative = True, context = None, before_read = None, after_read = None) (ydata, xdata) = (result.getReadable(0), result.getPositions(0)) (norm, mean, sigma) = fit(ydata, xdata) if (mean is not None) and (mean <= (axis_po + dx)) and (mean >= (axis_po - dx)):