diff --git a/script/test/FindCenter.py b/script/test/FindCenter.py index 9369c240..29743f91 100644 --- a/script/test/FindCenter.py +++ b/script/test/FindCenter.py @@ -6,10 +6,11 @@ import math # --- do not edit below --- -RELATIVE = True +RELATIVE = False LATENCY = 0.0 ZIGZAG = False ENDSCAN = False +START_POS = 0.0 adjust_sensors() set_adc_averaging() @@ -23,9 +24,8 @@ print "scienta time: ", scienta_time SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent) MOTORS = ManipulatorY -RANGE = (-5., +5.) +RANGE = (START_POS - 5., START_POS + 5.) STEP = 0.2 -MOTORS.move(0.) # time for one scan in seconds SPEED = STEP / scienta_time @@ -42,18 +42,15 @@ min_counts = min(readable) max_counts = max(readable) thresh = (max_counts - min_counts) / 2. + min_counts print "threshhold: ", thresh -sample_positions = [pos for idx, pos in enumerate(positions) if counts[idx] >= thresh] +sample_positions = [pos for idx, pos in enumerate(positions) if readable[idx] >= thresh] lo_edge = min(sample_positions) hi_edge = max(sample_positions) print "low and high edge: ", lo_edge, ", ", hi_edge -MOTORS.move(lo_edge) -RANGE = (-0.4, +0.4) +RANGE = (hi_edge - 0.4, hi_edge + 0.4) STEP = 0.01 result = cscan(MOTORS, SENSORS, RANGE[0], RANGE[1], STEPS, time=fly_time, before_read=before_readout, after_read = after_readout, check_positions = False) - -MOTORS.move(hi_edge) -RANGE = (-0.4, +0.4) +RANGE = (lo_edge - 0.4, lo_edge + 0.4) STEP = 0.01 result = cscan(MOTORS, SENSORS, RANGE[0], RANGE[1], STEPS, time=fly_time, before_read=before_readout, after_read = after_readout, check_positions = False)