From c1661ad5ae441d7b7ab31fcf089c0c3df0232adf Mon Sep 17 00:00:00 2001 From: x03daop Date: Wed, 3 Aug 2016 17:38:30 +0200 Subject: [PATCH] Script execution --- script/FocusYRotScan.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 script/FocusYRotScan.py diff --git a/script/FocusYRotScan.py b/script/FocusYRotScan.py new file mode 100644 index 00000000..559e5499 --- /dev/null +++ b/script/FocusYRotScan.py @@ -0,0 +1,34 @@ +""" +Refocusing mirror Ry scan + +set scan parameters below, move the mirror to the center position. +set analyser parameters separately! +""" + +import math + +# adjust the following parameters +DISTANCE = 0.2 +STEPS = 20 +LATENCY = 0.5 +ENDSCAN = False + +MOTORS = [RefocusYRot] +SENSORS = [Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution] +STARTPOS = (-DISTANCE / 2.0) +ENDPOS = (DISTANCE / 2.0) +RELATIVE = True + +adjust_sensors() +set_adc_averaging() + +def trig_sensors(): + wait_beam() + trig_scienta() + caput("X03DA-OP-10ADC:TRG.PROC", 1) + +try: + lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trig_sensors, after_read = after_readout) +finally: + if ENDSCAN: + after_scan()