diff --git a/script/XES_W1.py b/script/XES_W1.py new file mode 100644 index 0000000..f975eb6 --- /dev/null +++ b/script/XES_W1.py @@ -0,0 +1,88 @@ +#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', '300') +caput('X10DA-PILATUS-1:cam1:AcquirePeriod', '300.1') +caput('X10DA-ES1-MA1:TRX.VAL', '-18') +caput('X10DA-ES1-MA1:TRX1.VAL', '-15') + +#TODO: Set the diplay names of positioners and detectors +scan = ManualScan(['Pseudo'], ['SAI01-MEAN', 'SAI02', 'Ring-current', 'PilExpTime', 'Timestamp', 'PilFileNum', 'TotalCounts', 'TiffFileNumber', 'ROI4', 'ROI1[487]', 'ROI2[487]'] , [0.0], [30.0], [30]) +scan.start() + +#Creating channels: dimension 1 +#PseudoPositioner Pseudo +#ScalarDetector SAI01-MEAN +SAI01-MEAN = Channel('X10DA-ES1-SAI_01:MEAN', type = 'd') +#ScalarDetector SAI02 +SAI02 = Channel('X10DA-ES1-SAI_02:MEAN', type = 'd') +#ScalarDetector Ring-current +Ring-current = Channel('ARIDI-PCT:CURRENT', type = 'd') +#ScalarDetector PilExpTime +PilExpTime = Channel('X10DA-PILATUS-1:cam1:AcquireTime_RBV', type = 'd') +#Timestamp Timestamp +#ScalarDetector PilFileNum +PilFileNum = Channel('X10DA-PILATUS-1:cam1:FileNumber_RBV', type = 'd') +#ScalarDetector TotalCounts +TotalCounts = Channel('X10DA-PILATUS-1:Stats1:Total_RBV', type = 'd') +#ScalarDetector TiffFileNumber +TiffFileNumber = Channel('X10DA-PILATUS-1:Magick1:FileNumber_RBV', type = 'd') +#ScalarDetector ROI4 +ROI4 = Channel('X10DA-PILATUS-1:Stats4:Total_RBV', type = 'd') +#ArrayDetector ROI1 +ROI1 = Channel('X10DA-PILATUS-1:Stats1:ProfileCursorX_RBV', type = '[d', size = 487) +#ArrayDetector ROI2 +ROI2 = Channel('X10DA-PILATUS-1:Stats2:ProfileCursorX_RBV', type = '[d', size = 487) + +#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) + detector1 = SAI01-MEAN.get() + #Detector SAI02 + detector2 = SAI02.get() + #Detector Ring-current + detector3 = Ring-current.get() + #Detector PilExpTime + detector4 = PilExpTime.get() + #Detector Timestamp + detector5 = float(java.lang.System.currentTimeMillis()) + #Detector PilFileNum + detector6 = PilFileNum.get() + #Detector TotalCounts + detector7 = TotalCounts.get() + #Detector TiffFileNumber + detector8 = TiffFileNumber.get() + #Detector ROI4 + detector9 = ROI4.get() + #Detector ROI1 + detector10 = ROI1.get() + #Detector ROI2 + detector11 = ROI2.get() + scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9, detector10, detector11]) + +#Closing channels +SAI01-MEAN.close() +SAI02.close() +Ring-current.close() +PilExpTime.close() +PilFileNum.close() +TotalCounts.close() +TiffFileNumber.close() +ROI4.close() +ROI1.close() +ROI2.close() + +scan.end()