Files
x03da/script/optics/PhotonFluxSpectrum.py
2019-01-28 13:07:01 +01:00

98 lines
2.5 KiB
Python

"""
photon flux spectrum
SampleCurrent: diode
RefCurrent: RMU
AuxCurrent: not connected
"""
import time
RANGE = "G1200 full"
#RANGE = "G600 full"
#RANGE = "C K-edge"
BEAM = "G1200 1x1"
#BEAM = "G1200 6x10"
if RANGE == "G600 full":
# G600 full spectrum
STARTPOS = (50.0)
ENDPOS = (1100.0)
STEPS = 10.0
LATENCY = 5.0
DWELL = 1.0
elif RANGE == "G1200 full":
# G1200 full spectrum
STARTPOS = (125.0)
ENDPOS = (2000.0)
STEPS = 25.0
LATENCY = 5.0
DWELL = 1.0
elif RANGE == "C K-edge":
# carbon edge
STARTPOS = (250.0)
ENDPOS = (330.0)
STEPS = 0.2
LATENCY = 1.0
DWELL = 1.0
if BEAM == "G600 1x1":
# G600 1x1 reference sscan_2268 (elog:119)
#SampleCurrentGain.write("L, 10^7")
#RefCurrentGain.write("L, 10^9")
KeiSample.set_range(200e-9)
KeiReference.set_range(2e-9)
#caput(KEI_DIODE + "RANGE", 6) # 200 nA
#caput(KEI_RMU + "RANGE", 8) # 2 nA
#FrontendHSize.write(1.5)
#FrontendVSize.write(1.4)
ExitSlit.write(100.0)
elif BEAM == "G600 6x10":
# G600 6x10 reference sscan_2268 (elog:119)
#SampleCurrentGain.write("L, 10^5")
#RefCurrentGain.write("L, 10^7")
KeiSample.set_range(20e-6)
KeiReference.set_range(200e-9)
#caput(KEI_DIODE + "RANGE", 4) # 20 uA
#caput(KEI_RMU + "RANGE", 6) # 200 nA
#FrontendHSize.write(6.5)
#FrontendVSize.write(10.4)
ExitSlit.write(100.0)
elif BEAM == "G1200 1x1":
# G1200 1x1 reference sscan_2264 (elog:114)
#SampleCurrentGain.write("L, 10^7")
#RefCurrentGain.write("L, 10^9")
KeiSample.set_range(200e-9)
KeiReference.set_range(2e-9)
#caput(KEI_DIODE + "RANGE", 6) # 200 nA
#caput(KEI_RMU + "RANGE", 8) # 2 nA
#FrontendHSize.write(1.5)
#FrontendVSize.write(1.4)
ExitSlit.write(100.0)
elif BEAM == "G1200 6x10":
# G1200 6x10 reference sscan_2266 (elog:116)
#SampleCurrentGain.write("L, 10^6")
#RefCurrentGain.write("L, 10^8")
KeiSample.set_range(2e-6)
KeiReference.set_range(20e-9)
#caput(KEI_DIODE + "RANGE", 5) # 2 uA
#caput(KEI_RMU + "RANGE", 7) # 20 nA
#FrontendHSize.write(6.5)
#FrontendVSize.write(10.4)
ExitSlit.write(100.0)
else:
# use current settings
pass
#value = DWELL * 10.0
#SampleCurrentAveraging.write(value)
#RefCurrentAveraging.write(value)
POSITIONERS = (Eph)
SENSORS = (SampleCurrent, RefCurrent, MachineCurrent)
set_adc_averaging()
time.sleep(5.)
lscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, before_read=before_readout, after_read=after_readout)