Startup
This commit is contained in:
57
script/develop/ManipulatorXYFlyScan.py
Normal file
57
script/develop/ManipulatorXYFlyScan.py
Normal file
@@ -0,0 +1,57 @@
|
||||
"""
|
||||
Continuous 1D Manipulator scan (does not work)
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user