From 4e70ffc9a627d7c29243b1832e062668223181c0 Mon Sep 17 00:00:00 2001 From: x07maop Date: Fri, 11 Dec 2015 15:15:10 +0100 Subject: [PATCH] Script execution --- script/local.py | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/script/local.py b/script/local.py index 2c82d09..167c6c0 100644 --- a/script/local.py +++ b/script/local.py @@ -4,10 +4,6 @@ FILENAME = None data_file = None -#Uncomment this line to create the simulated devices needed to the tutorial scripts. -#run("tutorial/devices") - - #The persistence strategy is overriden to adjust file names import ch.psi.pshell.data.ScanPersistenceStrategyTable class Strategy(ch.psi.pshell.data.ScanPersistenceStrategyTable): @@ -67,3 +63,37 @@ class SimulatedEnergyReadback(Readable): sim_energy = SimulatedEnergy() sim_energy_readback = SimulatedEnergyReadback() + +################################################################################################### +#Definitions for importing text batch felis +################################################################################################### + +def set_hx(field, timeout = -1): + field_x.write(field) + field_x_done.waitValue(1,timeout) + +def setHz(field, timeout = -1): + field_z.write(field) + field_z_done.waitValue(1,timeout) + +def set_pol_cplus(off = None, timeout = -1): + pol_mode.write("CIRC +") + if off is not None: + offset.write(off) + pol_done.waitValue("DONE",timeout) + +def set_pol_cminus(off = None, timeout = -1): + pol_mode.write("CIRC -") + if off is not None: + offset.write(off) + pol_done.waitValue("DONE",timeout) + +def set_pol_lin(angle, off = None, timeout = -1): + pol_mode.write("LINEAR") + alpha.write(angle) + if off is not None: + offset.write(off) + pol_done.waitValue("DONE",timeout) + + + \ No newline at end of file