diff --git a/script/test/FindCenter.py b/script/test/FindCenter.py index d46cf3f7..6be36f43 100644 --- a/script/test/FindCenter.py +++ b/script/test/FindCenter.py @@ -25,7 +25,7 @@ print "scienta time: ", scienta_time STEP = 0.2 SPEED = STEP / scienta_time -fly_time = (RANGE[1] - RANGE[0]) / SPEED +fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 print "coarse scan" @@ -51,7 +51,7 @@ print "lower edge, upper edge: ", lo_edge, ", ", hi_edge RANGE = (lo_edge - 0.4, lo_edge + 0.4) STEP = 0.01 SPEED = STEP / scienta_time -fly_time = (RANGE[1] - RANGE[0]) / SPEED +fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 print "lower edge scan" @@ -64,7 +64,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 SPEED = STEP / scienta_time -fly_time = (RANGE[1] - RANGE[0]) / SPEED +fly_time = abs(RANGE[1] - RANGE[0]) / SPEED STEPS = int(fly_time / scienta_time) + 1 print "upper edge scan"