Files
x03da/script/develop/ManipulatorYZScanAtAngle.py
gac-x03da 62a5dc9ee5 Startup
2018-04-24 16:49:00 +02:00

49 lines
1.5 KiB
Python

"""
manipulator grid scan at non-normal theta angle
set manipulator scan parameters below.
set analyser parameters separately!
move manipulator to center position before start!
"""
import math
# adjust the following parameters
DISTANCE_XY = 1.0
DISTANCE_Z = 1.0
ANGLE = -30.0 # move the sample perpendicularly across the beam
#ANGLE = +60.0 # move the sample along the beam
POINTS_XY = 3
POINTS_Z = 3
SENSORS = (Counts, Scienta.spectrum, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution)
#SENSORS = (Counts, Scienta.dataMatrix, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution)
LATENCY = 1.0
ENDSCAN = True
# do not edit below
DISTANCE_X = DISTANCE_XY * math.cos(math.radians(ANGLE))
DISTANCE_Y = DISTANCE_XY * math.sin(math.radians(ANGLE))
RELATIVE = True
TOTAL_POINTS = POINTS_XY * POINTS_Z
zv = [(int(i / POINTS_Z) - (POINTS_Z - 1) / 2.) * DISTANCE_Z / 2. for i in range(TOTAL_POINTS)]
xyv = [((i % POINTS_Z) - (POINTS_XY - 1) / 2.) * DISTANCE_XY / 2. for i in range(TOTAL_POINTS)]
xv = [xy * math.cos(math.radians(ANGLE)) for xy in xyv]
yv = [xy * math.sin(math.radians(ANGLE)) for xy in xyv]
VECTOR = [[xv[i], yv[i], zv[i]] for i in range(TOTAL_POINTS)]
MOTORS = (ManipulatorX, ManipulatorY, ManipulatorZ)
adjust_sensors()
set_adc_averaging()
try:
vscan(MOTORS, SENSORS, VECTOR, line=False, latency=LATENCY, relative=RELATIVE, before_read=before_readout, after_read=after_readout)
finally:
if ENDSCAN:
after_scan()