138 lines
4.7 KiB
Python
138 lines
4.7 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')
|
|
caput('X10DA-ES1-MA1:TRX.VAL', '-18')
|
|
caput('X10DA-ES1-MA1:TRX1.VAL', '-15')
|
|
|
|
ROI1size=487
|
|
ROI2size=487
|
|
|
|
#TODO: Set the diplay names of positioners and detectors
|
|
scan = ManualScan(['Pseudo'], ['SAI01-MEAN_On','SAI01-MEAN_off', 'SAI02_On','SAI02_off', 'Ring-current_On','Ring-current_off', 'PilExpTime_On','PilExpTime_off', 'Timestamp_On','Timestamp_off', 'PilFileNum_On', 'PilFileNum_Off', 'TotalCounts_On','TotalCounts_Off', 'TiffFileNumber_On', 'TiffFileNumber_ff', 'ROI4_On','ROI4_Off', 'ROI1_On', 'ROI1_Off', 'ROI2_On','ROI2_Off','ROI4_Diff', 'ROI1_Diff','ROI2_Diff'] , [0.0], [30.0], [30])
|
|
scan.start()
|
|
|
|
#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 = ChannelDoubleArray('Roi1', 'X10DA-PILATUS-1:Stats1:ProfileCursorX_RBV', ROI1size)
|
|
#ArrayDetector ROI2
|
|
ROI2 = ChannelDoubleArray('Roi2', 'X10DA-PILATUS-1:Stats2:ProfileCursorX_RBV' , ROI2size)
|
|
|
|
|
|
#Dimension 1
|
|
#PseudoPositioner Pseudo
|
|
for setpoint1 in range(0, 30):
|
|
readback1 = setpoint1
|
|
#Detector SAI01-MEAN
|
|
#Detector X10DA-ES1-SAI_01:MEAN pre-actions
|
|
|
|
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)
|
|
|
|
detector1On = SAI01.get()
|
|
#Detector SAI02
|
|
detector2On = SAI02.get()
|
|
#Detector Ring-current
|
|
detector3On = RingCurrent.get()
|
|
#Detector PilExpTime
|
|
detector4On = PilExpTime.get()
|
|
#Detector Timestamp
|
|
detector5On = float(java.lang.System.currentTimeMillis())
|
|
#Detector PilFileNum
|
|
detector6On = PilFileNum.get()
|
|
#Detector TotalCounts
|
|
detector7On = TotalCounts.get()
|
|
#Detector TiffFileNumber
|
|
detector8On = TiffFileNumber.get()
|
|
#Detector ROI4
|
|
detector9On = ROI4.get()
|
|
#Detector ROI1
|
|
detector10On = ROI1.get()
|
|
#Detector ROI2
|
|
detector11On = ROI2.get()
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
detector1Off = SAI01.get()
|
|
#Detector SAI02
|
|
detector2Off = SAI02.get()
|
|
#Detector Ring-current
|
|
detector3Off = RingCurrent.get()
|
|
#Detector PilExpTime
|
|
detector4Off = PilExpTime.get()
|
|
#Detector Timestamp
|
|
detector5Off = float(java.lang.System.currentTimeMillis())
|
|
#Detector PilFileNum
|
|
detector6Off = PilFileNum.get()
|
|
#Detector TotalCounts
|
|
detector7Off = TotalCounts.get()
|
|
#Detector TiffFileNumber
|
|
detector8Off = TiffFileNumber.get()
|
|
#Detector ROI4
|
|
detector9Off = ROI4.get()
|
|
#Detector ROI1
|
|
detector10Off = ROI1.get()
|
|
#Detector ROI2
|
|
detector11Off = ROI2.get()
|
|
|
|
|
|
detector9Diff=detector9On-detector9Off
|
|
detector10Diff=detector10On;
|
|
detector11Diff=detector11On;
|
|
detector10Diff=arrsub(detector10On, detector10Off)
|
|
detector11Diff=arrsub(detector11On, detector11Off)
|
|
|
|
scan.append ([setpoint1], [readback1], [detector1On, detector1Off, detector2On, detector2Off, detector3On, detector3Off, detector4On, detector4Off, detector5On, detector5Off, detector6On,detector6Off, detector7On, detector7Off, detector8On, detector8Off, detector9On, detector9Off, detector10On, detector10Off, detector11On, detector11Off,detector9Diff,detector10Diff,detector11Diff])
|
|
|
|
|
|
|
|
#Closing channels
|
|
SAI01.close()
|
|
SAI02.close()
|
|
RingCurrent.close()
|
|
PilExpTime.close()
|
|
PilFileNum.close()
|
|
TotalCounts.close()
|
|
TiffFileNumber.close()
|
|
ROI4.close()
|
|
ROI1.close()
|
|
ROI2.close()
|
|
|
|
scan.end()
|