From 3a22ba0633ae2802e5f7aada48c108073d0fc725 Mon Sep 17 00:00:00 2001 From: x03daop Date: Wed, 23 Aug 2017 11:25:54 +0200 Subject: [PATCH] Startup --- script/optics/FocusXRotScan.py | 45 ++++++++++++++++++ script/optics/FocusYRotScan.py | 34 ++++++++++++++ script/optics/MonoThetaBetaScan.py | 33 ++++++++++++++ script/optics/PhotonFluxSpectrum.py | 71 +++++++++++++++++++++++++++++ 4 files changed, 183 insertions(+) create mode 100644 script/optics/FocusXRotScan.py create mode 100644 script/optics/FocusYRotScan.py create mode 100644 script/optics/MonoThetaBetaScan.py create mode 100644 script/optics/PhotonFluxSpectrum.py diff --git a/script/optics/FocusXRotScan.py b/script/optics/FocusXRotScan.py new file mode 100644 index 00000000..4070b248 --- /dev/null +++ b/script/optics/FocusXRotScan.py @@ -0,0 +1,45 @@ +""" +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() diff --git a/script/optics/FocusYRotScan.py b/script/optics/FocusYRotScan.py new file mode 100644 index 00000000..6ca07479 --- /dev/null +++ b/script/optics/FocusYRotScan.py @@ -0,0 +1,34 @@ +""" +Focusing mirror Ry scan + +set scan parameters below, move the mirror to the center position. +set analyser parameters separately! +""" + +import math + +# adjust the following parameters +DISTANCE = 0.08 +STEPS = 40 +LATENCY = 0.5 +ENDSCAN = False + +MOTORS = [FocusYRot] +SENSORS = [Counts, SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX] +STARTPOS = (-DISTANCE / 2.0) +ENDPOS = (DISTANCE / 2.0) +RELATIVE = True + +adjust_sensors() +set_adc_averaging() + +def trig_sensors(): + wait_beam() + #trig_scienta() + caput("X03DA-OP-10ADC:TRG.PROC", 1) + +try: + lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trig_sensors, after_read = after_readout) +finally: + if ENDSCAN: + after_scan() diff --git a/script/optics/MonoThetaBetaScan.py b/script/optics/MonoThetaBetaScan.py new file mode 100644 index 00000000..74164ed9 --- /dev/null +++ b/script/optics/MonoThetaBetaScan.py @@ -0,0 +1,33 @@ +""" +TEST: OTF scan for mono calibration + +under development - does not run yet + +tasks: +- find out positioner of beta angle and set up device (must be of motor class). +- load table of scan positions. +- add outer theta loop. +""" + +MOTORS = (MonoBeta) +SENSORS = (SampleCurrent, RefCurrent, MachineCurrent) +STARTPOS = (beta1) +ENDPOS = (beta2) +TIME = 120.0 # seconds +STEPS = 1000 +RELATIVE = False +ENDSCAN = False + +adjust_sensors() +set_adc_averaging() + +def trig_sensors(): + caput("X03DA-OP-10ADC:TRG.PROC", 1) + +try: + wait_beam() + cscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, time = TIME, relative = RELATIVE, before_read = trig_sensors) +finally: + if ENDSCAN: + after_scan() + diff --git a/script/optics/PhotonFluxSpectrum.py b/script/optics/PhotonFluxSpectrum.py new file mode 100644 index 00000000..ae133c28 --- /dev/null +++ b/script/optics/PhotonFluxSpectrum.py @@ -0,0 +1,71 @@ +""" +photon flux spectrum + +SampleCurrent: diode +RefCurrent: RMU +AuxCurrent: not connected +""" + +import time + +# G600 full spectrum +#STARTPOS = (50.0) +#ENDPOS = (1100.0) +#STEPS = 10.0 +#LATENCY = 5.0 +#DWELL = 1.0 + +# G1200 full spectrum +#STARTPOS = (100.0) +#ENDPOS = (2000.0) +#STEPS = 25.0 +#LATENCY = 5.0 +#DWELL = 1.0 + +# carbon edge +STARTPOS = (270.0) +ENDPOS = (310.0) +STEPS = 0.5 +LATENCY = 1.0 +DWELL = 1.0 + +# G600 1x1 reference sscan_2268 (elog:119) +#SampleCurrentGain.write("L, 10^7") +#RefCurrentGain.write("L, 10^9") +#FrontendHSize.write(1.5) +#FrontendVSize.write(1.4) +#ExitSlit.write(100.0) + +# G600 1x1 reference sscan_2268 (elog:119) +SampleCurrentGain.write("L, 10^5") +RefCurrentGain.write("L, 10^7") +FrontendHSize.write(6.5) +FrontendVSize.write(10.4) +ExitSlit.write(100.0) + +# G1200 1x1 reference sscan_2264 (elog:114) +#SampleCurrentGain.write("L, 10^8") +#RefCurrentGain.write("L, 10^9") +#FrontendHSize.write(1.5) +#FrontendVSize.write(1.4) +#ExitSlit.write(100.0) + +# G1200 6x10 reference sscan_2266 (elog:116) +#SampleCurrentGain.write("L, 10^6") +#RefCurrentGain.write("L, 10^8") +#FrontendHSize.write(6.5) +#FrontendVSize.write(10.4) +#ExitSlit.write(100.0) + +def trig(): + wait_beam() + caput("X03DA-OP-10ADC:TRG.PROC", 1) + +value = DWELL * 10.0 +SampleCurrentAveraging.write(value) +RefCurrentAveraging.write(value) + +POSITIONERS = (Eph) +SENSORS = (SampleCurrent, RefCurrent, MachineCurrent) + +lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=trig, after_read=after_readout)