46 lines
1.0 KiB
Python
46 lines
1.0 KiB
Python
"""
|
|
Theta scan of OTF XAS
|
|
|
|
set OTF parameters separately
|
|
|
|
"""
|
|
|
|
import math
|
|
|
|
STARTPOS = -45.5 - 60
|
|
ENDPOS = -45.5 + 60
|
|
STEPS = -10.
|
|
LATENCY = 0.0
|
|
ENDSCAN = True
|
|
RELATIVE = False
|
|
|
|
# do not edit below
|
|
|
|
OtfRunChannel = Channel("X03DA-OTF:RUN", type="i")
|
|
OtfEnergyChannel = Channel("X03DA-OTF:EDATA", type="[d", size=2000)
|
|
OtfCh1Channel = Channel("X03DA-OTF:IDATA1", type="[d", size=2000)
|
|
OtfCh2Channel = Channel("X03DA-OTF:IDATA2", type="[d", size=2000)
|
|
OtfMsgChannel = Channel("X03DA-OTF:MSG", type="s")
|
|
|
|
MOTOR = (ManipulatorPhi)
|
|
#MOTOR = (ManipulatorTheta)
|
|
#MOTOR = (dummy)
|
|
#SENSORS = (SampleCurrent, RefCurrent, MachineCurrent)
|
|
SENSORS = (OtfCh1Channel, OtfCh2Channel, OtfEnergyChannel)
|
|
|
|
|
|
def trigger_otf():
|
|
#wait_beam()
|
|
print("start otf")
|
|
OtfRunChannel.put(1)
|
|
time.sleep(10.)
|
|
print("waiting for otf")
|
|
OtfRunChannel.wait_for_value(0, 200)
|
|
print(OtfMsgChannel.get())
|
|
|
|
try:
|
|
lscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=trigger_otf, after_read = after_readout)
|
|
finally:
|
|
if ENDSCAN:
|
|
after_scan()
|