diff --git a/script/ManipulatorXYFlyScan.py b/script/ManipulatorXYFlyScan.py new file mode 100644 index 00000000..e2966c04 --- /dev/null +++ b/script/ManipulatorXYFlyScan.py @@ -0,0 +1,57 @@ +""" +Continuous 2D Manipulator scan + +set manipulator scan parameters below. +set analyser parameters separately! +""" + +import math + +import math + +# adjust the following parameters +DISTANCE = 2.0 +ANGLE = -30.0 # move sample across beam +#ANGLE = +60.0 # move sample along beam +# minimum speed 0.01, maximum speed 0.125 mm/s +SPEED = 0.1 +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)) + +SPEED_X = SPEED * math.cos(math.radians(ANGLE)) +SPEED_Y = SPEED * math.sin(math.radians(ANGLE)) + +MOTORS = (ManipulatorX, ManipulatorY) +SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution) +#SENSORS = (Counts, Scienta.spectrum, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution) +#SENSORS = (Counts, Scienta.dataMatrix, 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() + +# 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 Y scan in seconds +fly_time = DISTANCE / SPEED +STEPS = int(fly_time / scienta_time) + 1 +print "fly time: ", fly_time + +try: + cscan(MOTORS, SENSORS, STARTPOS, ENDPOS, 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