From 103291117f9e31bd8ba01cc3d6f17fe8377c1daf Mon Sep 17 00:00:00 2001 From: x07maop Date: Tue, 1 Mar 2016 12:08:04 +0100 Subject: [PATCH] Script execution --- script/local.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/script/local.py b/script/local.py index 09252fd..d096525 100644 --- a/script/local.py +++ b/script/local.py @@ -288,7 +288,16 @@ def wait_inj (value, delay=0.5): def set_file(file_name): FILENAME = file_name - +class pol_mode_index(Readable): + def read(self): + mode = pol_mode.read + if mode = "LINEAR": return 0 + if mode = "CIRC +": return 1 + if mode = "CIRC -": return 2 + return -1; +pmi = pol_mode_index() + + def otf(start, end, time, delay=0.0): run("EnergyScan", {"E1":start, "E2":end, "TIME":time, "DELAY":float(delay), "MODE":None, "OFFSET":None, "FOLDER":None, "FILE":None, "ALPHA":None}) @@ -307,12 +316,13 @@ def hyst_step_mult(forward, ranges, ramp_speed, energies): def scan_e(start, end, step, settling_time = 0, accumulation_time = None): #wait_beam() acc = Accumulator([signal_tey, signal_i0, signal_trans], accumulation_time) - detectors = acc.getSensors() + [pol_mode, pol_angle, temperature, current] + + detectors = acc.getSensors() + [pmi, pol_angle, temperature, current] lscan(energy, detectors, float(start), float(end), float(step), latency = settling_time) def scan_e_mult(ranges, settling_time = 0, accumulation_time = None): acc = Accumulator([signal_tey, signal_i0, signal_trans], accumulation_time) - detectors = acc.getSensors() + [pol_mode, pol_angle, temperature, current] + detectors = acc.getSensors() + [pmi, pol_angle, temperature, current] rscan(energy, detectors, ranges, latency = settling_time) #not connected