From 57b874221ee1cf325e4a166edd1843b70f061609 Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Mon, 9 Mar 2020 17:39:31 +0100 Subject: [PATCH] Script execution --- script/optics/OpticsFilterFlyScan.py | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 script/optics/OpticsFilterFlyScan.py diff --git a/script/optics/OpticsFilterFlyScan.py b/script/optics/OpticsFilterFlyScan.py new file mode 100644 index 00000000..8100453e --- /dev/null +++ b/script/optics/OpticsFilterFlyScan.py @@ -0,0 +1,44 @@ +""" +Continuous 1D Manipulator scan + +set manipulator scan parameters below. + +note that the motors have a limited speed range! +""" + +import math + +MOTORS = (OpticsFilterZ) +CENTER = 52. +WIDTH = 25. +RANGE = (CENTER - WIDTH / 2., CENTER + WIDTH / 2.) +STEP = 0.1 +DWELL_TIME = 1.0 + +SENSORS = (SampleCurrent, RefCurrent, MachineCurrent) + + +# --- do not edit below --- + +RELATIVE = False +LATENCY = 0.0 +ZIGZAG = False +ENDSCAN = False + +adjust_sensors() +set_adc_averaging() + +# time for one scan in seconds +SPEED = STEP / DWELL_TIME +print "speed: ", SPEED +fly_time = (RANGE[1] - RANGE[0]) / SPEED +STEPS = int(fly_time / DWELL_TIME) + 1 +print "scan time: ", fly_time + +try: + cscan(MOTORS, SENSORS, RANGE[0], RANGE[1], STEPS, time=fly_time, before_read=before_readout, after_read = after_readout, check_positions = False) + +finally: + if ENDSCAN: + after_scan() + \ No newline at end of file