Script execution

This commit is contained in:
gac-x03da
2019-08-13 11:11:19 +02:00
parent b11efaa31a
commit 3666b43e20

View File

@@ -0,0 +1,56 @@
"""
Manipulator scan across the beam relative to current position
set manipulator scan parameters below.
set analyser parameters separately!
move manipulator to center position before start!
set ANGLE = -30.0 to move the sample across the beam.
set ANGLE = +60.0 to move the sample along the beam.
"""
import math
# adjust the following parameters
DISTANCE = 2.0
STEP = 0.01
#ANGLE = -30.0 # move sample across beam
ANGLE = +60.0 # move sample along beam
SENSORS = (Counts, Scienta.dataMatrix, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution)
ENDSCAN = False
# --- do not edit below ---
DISTANCE_X = DISTANCE * math.cos(math.radians(ANGLE))
DISTANCE_Y = DISTANCE * math.sin(math.radians(ANGLE))
MOTORS = (ManipulatorX, ManipulatorY)
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 scan in seconds
SPEED = STEP / scienta_time
print "speed: ", SPEED
fly_time = DISTANCE / SPEED
STEPS = int(fly_time / scienta_time) + 1
print "scan time: ", fly_time
try:
set_exec_pars(compression=True)
cscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, time=fly_time, relative=RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
finally:
if ENDSCAN:
after_scan()