From 75f23bca9fdc0be90ac6c5f9807c5e710e758410 Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Mon, 15 Oct 2018 14:52:14 +0200 Subject: [PATCH] Script execution --- script/users/Granas/ManipulatorXYScan.py | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 script/users/Granas/ManipulatorXYScan.py diff --git a/script/users/Granas/ManipulatorXYScan.py b/script/users/Granas/ManipulatorXYScan.py new file mode 100644 index 00000000..443bfd5b --- /dev/null +++ b/script/users/Granas/ManipulatorXYScan.py @@ -0,0 +1,39 @@ +""" +Manipulator scan across the beam relative to current position + +set manipulator scan parameters below. +set analyser parameters separately! +move manipulator to center position before start! + +set ANGLE = -30.0 to move the sample across the beam. +set ANGLE = +60.0 to move the sample along the beam. +""" + +import math + +# adjust the following parameters +DISTANCE = 2.0 +ANGLE = -30.0 # move sample across beam +#ANGLE = +60.0 # move sample along beam +STEPS = 10 +LATENCY = 0.0 +ENDSCAN = False + +# do not edit below +DISTANCE_X = DISTANCE * math.cos(math.radians(ANGLE)) +DISTANCE_Y = DISTANCE * math.sin(math.radians(ANGLE)) + +MOTOR = (ManipulatorX, ManipulatorY) +SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution) +STARTPOS = (-DISTANCE_X / 2.0, -DISTANCE_Y / 2.0) +ENDPOS = (DISTANCE_X / 2.0, DISTANCE_Y / 2.0) +RELATIVE = True + +adjust_sensors() +set_adc_averaging() + +try: + lscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout) +finally: + if ENDSCAN: + after_scan()