Script execution
This commit is contained in:
@@ -3,32 +3,58 @@ Focusing mirror Ry scan
|
||||
|
||||
set scan parameters below, move the mirror to the center position.
|
||||
set analyser parameters separately!
|
||||
|
||||
changes
|
||||
-------
|
||||
|
||||
2022-06-22 implement fly scan
|
||||
"""
|
||||
|
||||
import math
|
||||
set_exec_pars(compression=True)
|
||||
|
||||
# adjust the following parameters
|
||||
DISTANCE = 1.
|
||||
STEPS = 50
|
||||
DISTANCE = 0.2
|
||||
STEPS = 0.002
|
||||
LATENCY = 0.5
|
||||
ENDSCAN = False
|
||||
|
||||
MOTORS = [FocusYRot]
|
||||
#SENSORS = [SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX, opps1img.getDataMatrix()]
|
||||
SENSORS = [SampleCurrent, RefCurrent, MachineCurrent]
|
||||
SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution)
|
||||
SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, Scienta.dataMatrix, EnergyDistribution, AngleDistribution)
|
||||
|
||||
STARTPOS = (-DISTANCE / 2.0)
|
||||
ENDPOS = (DISTANCE / 2.0)
|
||||
RELATIVE = True
|
||||
FLY_SCAN = True
|
||||
|
||||
adjust_sensors()
|
||||
set_adc_averaging()
|
||||
|
||||
try:
|
||||
lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
|
||||
if FLY_SCAN:
|
||||
# time per scienta acquisition in seconds
|
||||
trig_scienta()
|
||||
time1 = time.time()
|
||||
before_readout()
|
||||
time.sleep(0.2)
|
||||
time2 = time.time()
|
||||
scienta_time = (time2 - time1) + 1.
|
||||
print "step time: ", scienta_time
|
||||
|
||||
if isinstance(STEPS,int):
|
||||
STEPS = DISTANCE / STEPS
|
||||
|
||||
SPEED = STEPS / scienta_time
|
||||
fly_time = (RANGE[1] - RANGE[0]) / SPEED
|
||||
STEPS = int(fly_time / scienta_time) + 1
|
||||
|
||||
print "speed: ", SPEED
|
||||
print "scan time: ", fly_time
|
||||
cscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
|
||||
else:
|
||||
lscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
|
||||
finally:
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
after_scan()
|
||||
|
||||
Reference in New Issue
Block a user