62 lines
2.1 KiB
Python
62 lines
2.1 KiB
Python
#Script imported from: XES_W1.xml
|
|
|
|
#Pre-actions
|
|
caput('X10DA-ES1:START-CSMPL', '0')
|
|
sleep(0.1)
|
|
caput('X10DA-ES1:TOTAL-CYCLES', '1')
|
|
sleep(0.1)
|
|
caput('X10DA-PILATUS-1:cam1:AcquireTime', '1')
|
|
caput('X10DA-PILATUS-1:cam1:AcquirePeriod', '1.1')
|
|
|
|
|
|
ROI1size=194
|
|
ROI2size=194
|
|
|
|
|
|
#Creating channels: dimension 1
|
|
#PseudoPositioner Pseudo
|
|
#ScalarDetector SAI01-MEAN
|
|
SAI01 = ChannelDouble('X10DA-ES1-SAI_01:MEAN', 'X10DA-ES1-SAI_01:MEAN')
|
|
#ScalarDetector SAI02
|
|
SAI02 = ChannelDouble('X10DA-ES1-SAI_02:MEAN', 'X10DA-ES1-SAI_02:MEAN')
|
|
#ScalarDetector Ring-current
|
|
RingCurrent = ChannelDouble('ARIDI-PCT:CURRENT', 'ARIDI-PCT:CURRENT')
|
|
#ScalarDetector PilExpTime
|
|
PilExpTime = ChannelDouble('X10DA-PILATUS-1:cam1:AcquireTime_RBV', 'X10DA-PILATUS-1:cam1:AcquireTime_RBV')
|
|
#Timestamp Timestamp
|
|
#ScalarDetector PilFileNum
|
|
PilFileNum = ChannelDouble('X10DA-PILATUS-1:cam1:FileNumber_RBV', 'X10DA-PILATUS-1:cam1:FileNumber_RBV')
|
|
#ScalarDetector TotalCounts
|
|
TotalCounts = ChannelDouble('X10DA-PILATUS-1:Stats1:Total_RBV', 'X10DA-PILATUS-1:Stats1:Total_RBV')
|
|
#ScalarDetector TiffFileNumber
|
|
TiffFileNumber = ChannelDouble('X10DA-PILATUS-1:Magick1:FileNumber_RBV', 'X10DA-PILATUS-1:Magick1:FileNumber_RBV')
|
|
#ScalarDetector ROI4
|
|
ROI4 = ChannelDouble('X10DA-PILATUS-1:Stats4:Total_RBV', 'X10DA-PILATUS-1:Stats4:Total_RBV')
|
|
#ArrayDetector ROI1
|
|
ROI1_On = ChannelDoubleArray('Roi1', 'X10DA-PILATUS-1:Stats1:ProfileCursorX_RBV', ROI1size)
|
|
#ArrayDetector ROI2
|
|
ROI2_On = ChannelDoubleArray('Roi2', 'X10DA-PILATUS-1:Stats2:ProfileCursorX_RBV' , ROI2size)
|
|
|
|
|
|
detectors = [SAI01, SAI02, RingCurrent, PilExpTime, PilFileNum, TotalCounts, TiffFileNumber, TiffFileNumber, ROI4, ROI1_On, ROI2_On]
|
|
for det in detectors:
|
|
det.initialize()
|
|
|
|
|
|
|
|
def before_sample():
|
|
caputq('X10DA-PILATUS-1:cam1:Acquire', 1)
|
|
caputq('X10DA-ES1:SMPL', '1')
|
|
sleep(0.1)
|
|
cawait('X10DA-PILATUS-1:cam1:Acquire', 0, type = 'l')
|
|
cawait('X10DA-ES1:SMPL-DONE', 1, type = 'l')
|
|
sleep(0.1)
|
|
|
|
try:
|
|
tscan(detectors, 30, 0, before_read = before_sample, \
|
|
line_plots = [ROI1_On, ROI2_On], enabled_plots = [ROI1_On, ROI2_On])
|
|
finally:
|
|
for det in detectors:
|
|
det.close()
|
|
|