From a1f5a1d4677558499d77b353882ea05feb03cab8 Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Tue, 13 Aug 2019 15:17:39 +0200 Subject: [PATCH] Closedown --- script/test/FindCenter.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/script/test/FindCenter.py b/script/test/FindCenter.py index 2c2ea5b6..7744f217 100644 --- a/script/test/FindCenter.py +++ b/script/test/FindCenter.py @@ -1,26 +1,38 @@ """ -automated sample finder (EXPERIMENTAL) +automated sample finder for the Y axis (TESTING) + +the script first runs a coarse scan to find the lower and upper edges of the sample. +after that it runs a fine scan on either edge. + +set the scienta to a clear peak in fixed mode. """ import math +# estimated center of the sample +START_POS = 0.0 +# coarse scan range = estimated size of the sample + margins +COARSE_RANGE = 10.0 +# scienta dwell time (fixed mode) +DWELL_TIME = 0.5 + + # --- do not edit below --- RELATIVE = False LATENCY = 0.0 ZIGZAG = False ENDSCAN = False -START_POS = 0.0 SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent) MOTORS = ManipulatorY -RANGE = (START_POS + 5., START_POS - 5.) +RANGE = (START_POS + COARSE_RANGE / 2., START_POS - COARSE_RANGE / 2.) -Scienta.setExposure(0.5) -scienta_time = 3.75 +Scienta.setExposure(DWELL_TIME) +scienta_time = 3.25 + DWELL_TIME print "scienta time: ", scienta_time -STEP = 0.2 +STEP = 0.25 SPEED = STEP / scienta_time fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 @@ -49,7 +61,7 @@ print "lower edge, upper edge: ", lo_edge, ", ", hi_edge RANGE = (lo_edge - 0.4, lo_edge + 0.4) -STEP = 0.01 +STEP = 0.025 SPEED = STEP / scienta_time fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 @@ -62,7 +74,7 @@ cscan(MOTORS, SENSORS, RANGE[0], RANGE[1], STEPS, time=fly_time, before_read=bef RANGE = (hi_edge - 0.4, hi_edge + 0.4) -STEP = 0.01 +STEP = 0.025 SPEED = STEP / scienta_time fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 @@ -72,3 +84,5 @@ print "speed: ", SPEED print "scan time: ", fly_time cscan(MOTORS, SENSORS, RANGE[0], RANGE[1], STEPS, time=fly_time, before_read=before_readout, after_read = after_readout, check_positions = False) + +MOTORS.move((lo_edge + hi_edge) / 2)