diff --git a/script/ManipulatorFlyScan.py b/script/ManipulatorFlyScan.py new file mode 100644 index 00000000..250859c6 --- /dev/null +++ b/script/ManipulatorFlyScan.py @@ -0,0 +1,75 @@ +""" +Continuous 1D Manipulator scan + +set manipulator scan parameters below. +set analyser parameters in the scienta window. + +(dwell time + dead time) * speed should not be greater than the desired resolution! +note that the scienta has a dead time of 4 s! +""" + +import math + +MOTORS = (ManipulatorX) +RANGE = (-3.3-0.5, -3.3+0.5) +## minimum speed 0.02, maximum speed 0.125 mm/s +SPEED = 0.05 + +#MOTORS = (ManipulatorY) +#RANGE = (-5., +5.) +## minimum speed 0.02, maximum speed 0.125 mm/s +#SPEED = 0.1 + +#MOTORS = (ManipulatorZ) +#RANGE = (-5., +5.) +## minimum speed 0.05, maximum speed 1.0 mm/s +#SPEED = 0.1 + +#MOTORS = (ManipulatorTheta) +#RANGE = (-9., 81.) +## minimum speed 0.001, maximum speed 0.5 deg/s +#SPEED = 0.1 + +#MOTORS = (ManipulatorTilt) +#RANGE = (-20., +20.) +## minimum speed 0.1, maximum speed 1.4 mm/s +#SPEED = 1.0 + +#MOTORS = (ManipulatorPhi) +#RANGE = (-179., +180.) +## minimum speed 0.6, maximum speed 6.0 mm/s +#SPEED = 1.0 + + +SENSORS = (Counts, Scienta.dataMatrix, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution) + + +# --- do not edit below --- + +RELATIVE = False +LATENCY = 0.0 +ZIGZAG = False +ENDSCAN = False + +adjust_sensors() +set_adc_averaging() + +# time per scienta acquisition in seconds +time1 = time.time() +trig_scienta() +time2 = time.time() +scienta_time = (time2 - time1) +print "scienta time: ", scienta_time + +# time for one scan in seconds +fly_time = (RANGE[1] - RANGE[0]) / SPEED +STEPS = int(fly_time / scienta_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