""" Focusing mirror Rx scan to center the beam on the monochromator grating Rx = -20...+20 set the front end to 0.5 x 0.5, exit slit to 25, photon energy to 1500 """ import math # adjust the following parameters STARTPOS = (-5.0) ENDPOS = (+5.0) STEPS = 0.01 LATENCY = 1.0 DWELL = 1.0 ENDSCAN = False MOTORS = [FocusXRot] SENSORS = [SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX] RELATIVE = False value = DWELL * 10.0 SampleCurrentAveraging.write(value) RefCurrentAveraging.write(value) SampleCurrentGain.write("L, 10^9") RefCurrentGain.write("L, 10^9") # front end size includes offset! FrontendHSize.write(1.0) FrontendVSize.write(0.9) ExitSlit.write(25.0) adjust_sensors() set_adc_averaging() def trig(): wait_beam() caput("X03DA-OP-10ADC:TRG.PROC", 1) try: lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trig, after_read = after_readout) finally: if ENDSCAN: after_scan()