#Script imported from: points_q_0.xml #Variables K = 0.0 N_cycles = 0.0 numberOfExecutions = 5 #TODO: Support to multiple iterations is partial: check if logic is ok for iteration in range(numberOfExecutions): #Pre-actions p = subproccess.Popen('/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_fda_file_to_EPICS.sh ${FILENAME}' +, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.communicate() ret = p.returncode p = subproccess.Popen('/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_fda_write_header.py' +, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.communicate() ret = p.returncode caput('X07MB-OP2:START-CSMPL', '0') sleep(0.05) caput('X07MB-XMAP:StopAll', '1') sleep(0.05) caput('X07MB-XMAP:CollectMode', '0') sleep(0.05) caput('X07MB-XMAP:Apply', '1') sleep(0.05) caput('X07MB-XMAP:PresetReal', '0') sleep(0.05) caput('X07MB-OP2:TOTAL-CYCLES', '5') sleep(0.05) caput('X07MB-ES1-PP2:VO5', '0') sleep(0.05) caput('X07MB-OP-WV1:WT_SET', '1') sleep(0.05) caput('X07MB-ES1-PP2:VO4', '0') sleep(0.15) #TODO: Set the diplay names of positioners and detectors scan = ManualScan(['Energy'], ['Energy_set', 'Mono_offset', 'I_SLS', 'PRESSURE', 'Theta_2', 'Diode_BM', 'I0_KEITHLEY1', 'KEITHLEY1_GAIN', 'I1_KEITHLEY2', 'KEITHLEY2_GAIN', 'XBPM3_GAIN', 'XBPM3_SAI14_CUR_MEAN', 'XBPM3_SAI15_CUR_MEAN', 'XBPM3_SAI16_CUR_MEAN', 'XBPM3_SAI17_CUR_MEAN', 'XBPM3_POSX', 'XBPM3_POSY', 'XBPM4_GAIN', 'XBPM4_SAI19_CUR_MEAN', 'XBPM4_SAI20_CUR_MEAN', 'XBPM4_SAI21_CUR_MEAN', 'XBPM4_SAI22_CUR_MEAN', 'XBPM4_POSX', 'XBPM4_POSY', 'D1_CuKa', 'D1_CuKa_dxp', 'D1_AlKa', 'D1_AlKa_dxp', 'D1_SiKa', 'D1_SiKa_dxp', 'D2_CuKa', 'D2_CuKa_dxp', 'D2_AlKa', 'D2_AlKa_dxp', 'D2_SiKa', 'D2_SiKa_dxp', 'D3_CuKa', 'D3_CuKa_dxp', 'D3_AlKa', 'D3_AlKa_dxp', 'D3_SiKa', 'D3_SiKa_dxp', 'D4_CuKa', 'D4_CuKa_dxp', 'D4_AlKa', 'D4_AlKa_dxp', 'D4_SiKa', 'D4_SiKa_dxp', 'D1_ICR', 'D1_OCR', 'DD1_ELTM', 'DD1_ERTM', 'DD1_DTIM', 'D2_ICR', 'D2_OCR', 'DD2_ELTM', 'DD2_ERTM', 'DD2_DTIM', 'D3_ICR', 'D3_OCR', 'DD3_ELTM', 'DD3_ERTM', 'DD3_DTIM', 'D4_ICR', 'D4_OCR', 'DD4_ELTM', 'DD4_ERTM', 'DD4_DTIM', 'Spec_1[2048]', 'Spec_2[2048]', 'Spec_3[2048]', 'Spec_4[2048]', 'D1_TrueICR', 'D2_TrueICR', 'D3_TrueICR', 'D4_TrueICR', 'D1_CuKa_corr', 'D1_CuKa_corr_over_PRESSURE', 'D1_CuKa_corr_over_Theta_2', 'D1_CuKa_corr_over_Diode_BM', 'D2_CuKa_corr', 'D2_CuKa_corr_over_PRESSURE', 'D2_CuKa_corr_over_Theta_2', 'D2_CuKa_corr_over_Diode_BM', 'D3_CuKa_corr', 'D3_CuKa_corr_over_PRESSURE', 'D3_CuKa_corr_over_Theta_2', 'D3_CuKa_corr_over_Diode_BM', 'D4_CuKa_corr', 'D4_CuKa_corr_over_PRESSURE', 'D4_CuKa_corr_over_Theta_2', 'D4_CuKa_corr_over_Diode_BM', 'CuKa_sum_cps', 'D1_AlKa_corr', 'D1_AlKa_corr_over_PRESSURE', 'D1_AlKa_corr_over_Theta_2', 'D1_AlKa_corr_over_Diode_BM', 'D2_AlKa_corr', 'D2_AlKa_corr_over_PRESSURE', 'D2_AlKa_corr_over_Theta_2', 'D2_AlKa_corr_over_Diode_BM', 'D3_AlKa_corr', 'D3_AlKa_corr_over_PRESSURE', 'D3_AlKa_corr_over_Theta_2', 'D3_AlKa_corr_over_Diode_BM', 'D4_AlKa_corr', 'D4_AlKa_corr_over_PRESSURE', 'D4_AlKa_corr_over_Theta_2', 'D4_AlKa_corr_over_Diode_BM', 'AlKa_sum_cps', 'D1_SiKa_corr', 'D1_SiKa_corr_over_PRESSURE', 'D1_SiKa_corr_over_Theta_2', 'D1_SiKa_corr_over_Diode_BM', 'D2_SiKa_corr', 'D2_SiKa_corr_over_PRESSURE', 'D2_SiKa_corr_over_Theta_2', 'D2_SiKa_corr_over_Diode_BM', 'D3_SiKa_corr', 'D3_SiKa_corr_over_PRESSURE', 'D3_SiKa_corr_over_Theta_2', 'D3_SiKa_corr_over_Diode_BM', 'D4_SiKa_corr', 'D4_SiKa_corr_over_PRESSURE', 'D4_SiKa_corr_over_Theta_2', 'D4_SiKa_corr_over_Diode_BM', 'SiKa_sum_cps'] , [1500.0], [1800.0], [261]) scan.start() #Creating channels: dimension 1 #RegionPositioner Energy Energy = Channel('X07MB-OP-MO:E-SET', type = 'd') EnergyReadback = Channel('X07MB-OP-MO:E-GET', type = 'd') #ScalarDetector Energy_set Energy_set = Channel('X07MB-OP-MO:E-SET', type = 'd') #ScalarDetector Mono_offset Mono_offset = Channel('X07MB-OP-MO:BEAM-OFS', type = 'd') #ScalarDetector I_SLS I_SLS = Channel('ARIDI-PCT:CURRENT', type = 'd') #ScalarDetector PRESSURE PRESSURE = Channel('X07MB-ES3-MC1:PRESSURE', type = 'd') #ScalarDetector Theta_2 Theta_2 = Channel('X07MB-ES1:userCalc1.VAL', type = 'd') #ScalarDetector Diode_BM Diode_BM = Channel('X07MB-OP2-SAI_04:MEAN', type = 'd') #ScalarDetector I0_KEITHLEY1 I0_KEITHLEY1 = Channel('X07MB-OP2-SAI_07:MEAN', type = 'd') #ScalarDetector KEITHLEY1_GAIN KEITHLEY1_GAIN = Channel('X07MB-OP-KEITH1:setGain', type = 'd') #ScalarDetector I1_KEITHLEY2 I1_KEITHLEY2 = Channel('X07MB-OP2-SAI_08:MEAN', type = 'd') #ScalarDetector KEITHLEY2_GAIN KEITHLEY2_GAIN = Channel('X07MB-OP-KEITH2:setGain', type = 'd') #ScalarDetector XBPM3_GAIN XBPM3_GAIN = Channel('X07MB-OP2:LCAD3-GAIN', type = 'd') #ScalarDetector XBPM3_SAI14_CUR_MEAN XBPM3_SAI14_CUR_MEAN = Channel('X07MB-OP2-SAI_14:CUR-MEAN', type = 'd') #ScalarDetector XBPM3_SAI15_CUR_MEAN XBPM3_SAI15_CUR_MEAN = Channel('X07MB-OP2-SAI_15:CUR-MEAN', type = 'd') #ScalarDetector XBPM3_SAI16_CUR_MEAN XBPM3_SAI16_CUR_MEAN = Channel('X07MB-OP2-SAI_16:CUR-MEAN', type = 'd') #ScalarDetector XBPM3_SAI17_CUR_MEAN XBPM3_SAI17_CUR_MEAN = Channel('X07MB-OP2-SAI_17:CUR-MEAN', type = 'd') #ScalarDetector XBPM3_POSX XBPM3_POSX = Channel('X07MB-OP-BPM3:POSX', type = 'd') #ScalarDetector XBPM3_POSY XBPM3_POSY = Channel('X07MB-OP-BPM3:POSY', type = 'd') #ScalarDetector XBPM4_GAIN XBPM4_GAIN = Channel('X07MB-OP2:LCAD3-GAIN', type = 'd') #ScalarDetector XBPM4_SAI19_CUR_MEAN XBPM4_SAI19_CUR_MEAN = Channel('X07MB-OP2-SAI_19:CUR-MEAN', type = 'd') #ScalarDetector XBPM4_SAI20_CUR_MEAN XBPM4_SAI20_CUR_MEAN = Channel('X07MB-OP2-SAI_20:CUR-MEAN', type = 'd') #ScalarDetector XBPM4_SAI21_CUR_MEAN XBPM4_SAI21_CUR_MEAN = Channel('X07MB-OP2-SAI_21:CUR-MEAN', type = 'd') #ScalarDetector XBPM4_SAI22_CUR_MEAN XBPM4_SAI22_CUR_MEAN = Channel('X07MB-OP2-SAI_22:CUR-MEAN', type = 'd') #ScalarDetector XBPM4_POSX XBPM4_POSX = Channel('X07MB-OP-BPM4:POSX', type = 'd') #ScalarDetector XBPM4_POSY XBPM4_POSY = Channel('X07MB-OP-BPM4:POSY', type = 'd') #ScalarDetector D1_CuKa D1_CuKa = Channel('X07MB-XMAP:mca1.R0', type = 'd') #ScalarDetector D1_CuKa_dxp D1_CuKa_dxp = Channel('X07MB-XMAP:dxp1:SCA0Counts', type = 'd') #ScalarDetector D1_AlKa D1_AlKa = Channel('X07MB-XMAP:mca1.R1', type = 'd') #ScalarDetector D1_AlKa_dxp D1_AlKa_dxp = Channel('X07MB-XMAP:dxp1:SCA1Counts', type = 'd') #ScalarDetector D1_SiKa D1_SiKa = Channel('X07MB-XMAP:mca1.R2', type = 'd') #ScalarDetector D1_SiKa_dxp D1_SiKa_dxp = Channel('X07MB-XMAP:dxp1:SCA2Counts', type = 'd') #ScalarDetector D2_CuKa D2_CuKa = Channel('X07MB-XMAP:mca2.R0', type = 'd') #ScalarDetector D2_CuKa_dxp D2_CuKa_dxp = Channel('X07MB-XMAP:dxp2:SCA0Counts', type = 'd') #ScalarDetector D2_AlKa D2_AlKa = Channel('X07MB-XMAP:mca2.R1', type = 'd') #ScalarDetector D2_AlKa_dxp D2_AlKa_dxp = Channel('X07MB-XMAP:dxp2:SCA1Counts', type = 'd') #ScalarDetector D2_SiKa D2_SiKa = Channel('X07MB-XMAP:mca2.R2', type = 'd') #ScalarDetector D2_SiKa_dxp D2_SiKa_dxp = Channel('X07MB-XMAP:dxp2:SCA2Counts', type = 'd') #ScalarDetector D3_CuKa D3_CuKa = Channel('X07MB-XMAP:mca3.R0', type = 'd') #ScalarDetector D3_CuKa_dxp D3_CuKa_dxp = Channel('X07MB-XMAP:dxp3:SCA0Counts', type = 'd') #ScalarDetector D3_AlKa D3_AlKa = Channel('X07MB-XMAP:mca3.R1', type = 'd') #ScalarDetector D3_AlKa_dxp D3_AlKa_dxp = Channel('X07MB-XMAP:dxp3:SCA1Counts', type = 'd') #ScalarDetector D3_SiKa D3_SiKa = Channel('X07MB-XMAP:mca3.R2', type = 'd') #ScalarDetector D3_SiKa_dxp D3_SiKa_dxp = Channel('X07MB-XMAP:dxp3:SCA2Counts', type = 'd') #ScalarDetector D4_CuKa D4_CuKa = Channel('X07MB-XMAP:mca4.R0', type = 'd') #ScalarDetector D4_CuKa_dxp D4_CuKa_dxp = Channel('X07MB-XMAP:dxp4:SCA0Counts', type = 'd') #ScalarDetector D4_AlKa D4_AlKa = Channel('X07MB-XMAP:mca4.R1', type = 'd') #ScalarDetector D4_AlKa_dxp D4_AlKa_dxp = Channel('X07MB-XMAP:dxp4:SCA1Counts', type = 'd') #ScalarDetector D4_SiKa D4_SiKa = Channel('X07MB-XMAP:mca4.R2', type = 'd') #ScalarDetector D4_SiKa_dxp D4_SiKa_dxp = Channel('X07MB-XMAP:dxp4:SCA2Counts', type = 'd') #ScalarDetector D1_ICR D1_ICR = Channel('X07MB-XMAP:dxp1:InputCountRate', type = 'd') #ScalarDetector D1_OCR D1_OCR = Channel('X07MB-XMAP:dxp1:OutputCountRate', type = 'd') #ScalarDetector DD1_ELTM DD1_ELTM = Channel('X07MB-XMAP:mca1.ELTM', type = 'd') #ScalarDetector DD1_ERTM DD1_ERTM = Channel('X07MB-XMAP:mca1.ERTM', type = 'd') #ScalarDetector DD1_DTIM DD1_DTIM = Channel('X07MB-XMAP:mca1.DTIM', type = 'd') #ScalarDetector D2_ICR D2_ICR = Channel('X07MB-XMAP:dxp2:InputCountRate', type = 'd') #ScalarDetector D2_OCR D2_OCR = Channel('X07MB-XMAP:dxp2:OutputCountRate', type = 'd') #ScalarDetector DD2_ELTM DD2_ELTM = Channel('X07MB-XMAP:mca2.ELTM', type = 'd') #ScalarDetector DD2_ERTM DD2_ERTM = Channel('X07MB-XMAP:mca2.ERTM', type = 'd') #ScalarDetector DD2_DTIM DD2_DTIM = Channel('X07MB-XMAP:mca2.DTIM', type = 'd') #ScalarDetector D3_ICR D3_ICR = Channel('X07MB-XMAP:dxp3:InputCountRate', type = 'd') #ScalarDetector D3_OCR D3_OCR = Channel('X07MB-XMAP:dxp3:OutputCountRate', type = 'd') #ScalarDetector DD3_ELTM DD3_ELTM = Channel('X07MB-XMAP:mca3.ELTM', type = 'd') #ScalarDetector DD3_ERTM DD3_ERTM = Channel('X07MB-XMAP:mca3.ERTM', type = 'd') #ScalarDetector DD3_DTIM DD3_DTIM = Channel('X07MB-XMAP:mca3.DTIM', type = 'd') #ScalarDetector D4_ICR D4_ICR = Channel('X07MB-XMAP:dxp4:InputCountRate', type = 'd') #ScalarDetector D4_OCR D4_OCR = Channel('X07MB-XMAP:dxp4:OutputCountRate', type = 'd') #ScalarDetector DD4_ELTM DD4_ELTM = Channel('X07MB-XMAP:mca4.ELTM', type = 'd') #ScalarDetector DD4_ERTM DD4_ERTM = Channel('X07MB-XMAP:mca4.ERTM', type = 'd') #ScalarDetector DD4_DTIM DD4_DTIM = Channel('X07MB-XMAP:mca4.DTIM', type = 'd') #ArrayDetector Spec_1 Spec_1 = Channel('X07MB-XMAP:mca1.VAL', type = '[d', size = 2048) #ArrayDetector Spec_2 Spec_2 = Channel('X07MB-XMAP:mca2.VAL', type = '[d', size = 2048) #ArrayDetector Spec_3 Spec_3 = Channel('X07MB-XMAP:mca3.VAL', type = '[d', size = 2048) #ArrayDetector Spec_4 Spec_4 = Channel('X07MB-XMAP:mca4.VAL', type = '[d', size = 2048) #Dimension 1 #Dimension Guard cawait('ACOAU-ACCU:OP-MODE', 6, type = 'l') #RegionPositioner Energy for setpoint1 in frange(1500.0, 1557.0, 3.0, True) + frange(1557.1, 1561.4, 0.1, True) + frange(1561.5, 1575.0, 0.3, True) + frange(1576.0, 1650.0, 1.0, True) + frange(1651.0, 1800.0, 2.0, True): #Region 1 pre-actions if setpoint1 == 1500.0: caput('X07MB-OP2:TOTAL-CYCLES', '5') #Region 2 pre-actions if setpoint1 == 1557.1: caput('X07MB-OP2:TOTAL-CYCLES', '10') #Region 3 pre-actions if setpoint1 == 1561.5: caput('X07MB-OP2:TOTAL-CYCLES', '10') #Region 4 pre-actions if setpoint1 == 1576.0: caput('X07MB-OP2:TOTAL-CYCLES', '10') #Region 5 pre-actions if setpoint1 == 1651.0: caput('X07MB-OP2:TOTAL-CYCLES', '10') Energy.put(setpoint1, timeout=None) # TODO: Set appropriate timeout readback1 = EnergyReadback.get() if abs(readback1 - setpoint1) > 0.05 : # TODO: Check accuracy raise Exception('Actor Energy could not be set to the value ' + str(setpoint1)) sleep( 0.2 ) # Settling time #Dimension Actions caputq('X07MB-XMAP:EraseStart', '1') sleep(0.075) caput('X07MB-OP2:SMPL', '1') sleep(0.075) cawait('X07MB-OP2:SMPL-DONE', 1, type = 'l') sleep(0.075) caput('X07MB-XMAP:StopAll', '1') sleep(0.05) #Detector Energy_set detector1 = Energy_set.get() #Detector Mono_offset detector2 = Mono_offset.get() #Detector I_SLS detector3 = I_SLS.get() #Detector PRESSURE detector4 = PRESSURE.get() #Detector Theta_2 detector5 = Theta_2.get() #Detector Diode_BM detector6 = Diode_BM.get() #Detector I0_KEITHLEY1 detector7 = I0_KEITHLEY1.get() #Detector KEITHLEY1_GAIN detector8 = KEITHLEY1_GAIN.get() #Detector I1_KEITHLEY2 detector9 = I1_KEITHLEY2.get() #Detector KEITHLEY2_GAIN detector10 = KEITHLEY2_GAIN.get() #Detector XBPM3_GAIN detector11 = XBPM3_GAIN.get() #Detector XBPM3_SAI14_CUR_MEAN detector12 = XBPM3_SAI14_CUR_MEAN.get() #Detector XBPM3_SAI15_CUR_MEAN detector13 = XBPM3_SAI15_CUR_MEAN.get() #Detector XBPM3_SAI16_CUR_MEAN detector14 = XBPM3_SAI16_CUR_MEAN.get() #Detector XBPM3_SAI17_CUR_MEAN detector15 = XBPM3_SAI17_CUR_MEAN.get() #Detector XBPM3_POSX detector16 = XBPM3_POSX.get() #Detector XBPM3_POSY detector17 = XBPM3_POSY.get() #Detector XBPM4_GAIN detector18 = XBPM4_GAIN.get() #Detector XBPM4_SAI19_CUR_MEAN detector19 = XBPM4_SAI19_CUR_MEAN.get() #Detector XBPM4_SAI20_CUR_MEAN detector20 = XBPM4_SAI20_CUR_MEAN.get() #Detector XBPM4_SAI21_CUR_MEAN detector21 = XBPM4_SAI21_CUR_MEAN.get() #Detector XBPM4_SAI22_CUR_MEAN detector22 = XBPM4_SAI22_CUR_MEAN.get() #Detector XBPM4_POSX detector23 = XBPM4_POSX.get() #Detector XBPM4_POSY detector24 = XBPM4_POSY.get() #Detector D1_CuKa detector25 = D1_CuKa.get() #Detector D1_CuKa_dxp detector26 = D1_CuKa_dxp.get() #Detector D1_AlKa detector27 = D1_AlKa.get() #Detector D1_AlKa_dxp detector28 = D1_AlKa_dxp.get() #Detector D1_SiKa detector29 = D1_SiKa.get() #Detector D1_SiKa_dxp detector30 = D1_SiKa_dxp.get() #Detector D2_CuKa detector31 = D2_CuKa.get() #Detector D2_CuKa_dxp detector32 = D2_CuKa_dxp.get() #Detector D2_AlKa detector33 = D2_AlKa.get() #Detector D2_AlKa_dxp detector34 = D2_AlKa_dxp.get() #Detector D2_SiKa detector35 = D2_SiKa.get() #Detector D2_SiKa_dxp detector36 = D2_SiKa_dxp.get() #Detector D3_CuKa detector37 = D3_CuKa.get() #Detector D3_CuKa_dxp detector38 = D3_CuKa_dxp.get() #Detector D3_AlKa detector39 = D3_AlKa.get() #Detector D3_AlKa_dxp detector40 = D3_AlKa_dxp.get() #Detector D3_SiKa detector41 = D3_SiKa.get() #Detector D3_SiKa_dxp detector42 = D3_SiKa_dxp.get() #Detector D4_CuKa detector43 = D4_CuKa.get() #Detector D4_CuKa_dxp detector44 = D4_CuKa_dxp.get() #Detector D4_AlKa detector45 = D4_AlKa.get() #Detector D4_AlKa_dxp detector46 = D4_AlKa_dxp.get() #Detector D4_SiKa detector47 = D4_SiKa.get() #Detector D4_SiKa_dxp detector48 = D4_SiKa_dxp.get() #Detector D1_ICR detector49 = D1_ICR.get() #Detector D1_OCR detector50 = D1_OCR.get() #Detector DD1_ELTM detector51 = DD1_ELTM.get() #Detector DD1_ERTM detector52 = DD1_ERTM.get() #Detector DD1_DTIM detector53 = DD1_DTIM.get() #Detector D2_ICR detector54 = D2_ICR.get() #Detector D2_OCR detector55 = D2_OCR.get() #Detector DD2_ELTM detector56 = DD2_ELTM.get() #Detector DD2_ERTM detector57 = DD2_ERTM.get() #Detector DD2_DTIM detector58 = DD2_DTIM.get() #Detector D3_ICR detector59 = D3_ICR.get() #Detector D3_OCR detector60 = D3_OCR.get() #Detector DD3_ELTM detector61 = DD3_ELTM.get() #Detector DD3_ERTM detector62 = DD3_ERTM.get() #Detector DD3_DTIM detector63 = DD3_DTIM.get() #Detector D4_ICR detector64 = D4_ICR.get() #Detector D4_OCR detector65 = D4_OCR.get() #Detector DD4_ELTM detector66 = DD4_ELTM.get() #Detector DD4_ERTM detector67 = DD4_ERTM.get() #Detector DD4_DTIM detector68 = DD4_DTIM.get() #Detector Spec_1 detector69 = Spec_1.get() #Detector Spec_2 detector70 = Spec_2.get() #Detector Spec_3 detector71 = Spec_3.get() #Detector Spec_4 detector72 = Spec_4.get() #Manipulation D2_AlKa_corr_over_Diode_BM #Variable Mappings a = detector33_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D2_AlKa_corr_over_Diode_BM = (a/b) #Manipulation D4_AlKa_corr_over_Theta_2 #Variable Mappings a = detector45_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D4_AlKa_corr_over_Theta_2 = (a/b) #Manipulation D2_SiKa_corr #Variable Mappings a = detector35 b = detector54 c = detector55 d = detector57 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D2_SiKa_corr = box if (ICR) == 0: box = 0 D2_SiKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D2_SiKa_corr = box #Manipulation D2_CuKa_corr_over_Diode_BM #Variable Mappings a = detector31_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D2_CuKa_corr_over_Diode_BM = (a/b) #Manipulation D3_CuKa_corr #Variable Mappings a = detector37 b = detector59 c = detector60 d = detector62 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D3_CuKa_corr = box if (ICR) == 0: box = 0 D3_CuKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D3_CuKa_corr = box #Manipulation D3_CuKa_corr_over_Theta_2 #Variable Mappings a = detector37_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D3_CuKa_corr_over_Theta_2 = (a/b) #Manipulation D1_SiKa_corr_over_Diode_BM #Variable Mappings a = detector29_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D1_SiKa_corr_over_Diode_BM = (a/b) #Manipulation D4_AlKa_corr_over_PRESSURE #Variable Mappings a = detector45_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D4_AlKa_corr_over_PRESSURE = (a/b) #Manipulation D4_TrueICR #Variable Mappings b = detector64 c = detector65 d = detector67 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D4_TrueICR = box if (ICR) == 0: box = 0 D4_TrueICR = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR) <> 0: box = TrueICR if (OCR*d) == 0: box=0.0 D4_TrueICR = box #Manipulation D4_SiKa_corr_over_Theta_2 #Variable Mappings a = detector47_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D4_SiKa_corr_over_Theta_2 = (a/b) #Manipulation D2_CuKa_corr_over_PRESSURE #Variable Mappings a = detector31_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D2_CuKa_corr_over_PRESSURE = (a/b) #Manipulation D3_AlKa_corr #Variable Mappings a = detector39 b = detector59 c = detector60 d = detector62 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D3_AlKa_corr = box if (ICR) == 0: box = 0 D3_AlKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D3_AlKa_corr = box #Manipulation D2_TrueICR #Variable Mappings b = detector54 c = detector55 d = detector57 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D2_TrueICR = box if (ICR) == 0: box = 0 D2_TrueICR = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR) <> 0: box = TrueICR if (OCR*d) == 0: box=0.0 D2_TrueICR = box #Manipulation D3_SiKa_corr_over_Diode_BM #Variable Mappings a = detector41_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D3_SiKa_corr_over_Diode_BM = (a/b) #Manipulation D2_CuKa_corr_over_Theta_2 #Variable Mappings a = detector31_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D2_CuKa_corr_over_Theta_2 = (a/b) #Manipulation D1_AlKa_corr #Variable Mappings a = detector27 b = detector49 c = detector50 d = detector52 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D1_AlKa_corr = box if (ICR) == 0: box = 0 D1_AlKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D1_AlKa_corr = box #Manipulation D3_SiKa_corr #Variable Mappings a = detector41 b = detector59 c = detector60 d = detector62 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D3_SiKa_corr = box if (ICR) == 0: box = 0 D3_SiKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D3_SiKa_corr = box #Manipulation D2_CuKa_corr #Variable Mappings a = detector31 b = detector54 c = detector55 d = detector57 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D2_CuKa_corr = box if (ICR) == 0: box = 0 D2_CuKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D2_CuKa_corr = box #Manipulation D1_SiKa_corr_over_PRESSURE #Variable Mappings a = detector29_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D1_SiKa_corr_over_PRESSURE = (a/b) #Manipulation D1_AlKa_corr_over_PRESSURE #Variable Mappings a = detector27_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D1_AlKa_corr_over_PRESSURE = (a/b) #Manipulation D1_AlKa_corr_over_Theta_2 #Variable Mappings a = detector27_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D1_AlKa_corr_over_Theta_2 = (a/b) #Manipulation AlKa_sum_cps #Variable Mappings detector27_corr = detector27_corr detector33_corr = detector33_corr detector39_corr = detector39_corr detector45_corr = detector45_corr #TODO: Move, if needed, this import to the file header: import math SUM_DET = 0. SUM_DET = SUM_DET + detector27_corr SUM_DET = SUM_DET + detector33_corr SUM_DET = SUM_DET + detector39_corr SUM_DET = SUM_DET + detector45_corr AlKa_sum_cps = SUM_DET #Manipulation D3_AlKa_corr_over_Diode_BM #Variable Mappings a = detector39_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D3_AlKa_corr_over_Diode_BM = (a/b) #Manipulation D3_SiKa_corr_over_Theta_2 #Variable Mappings a = detector41_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D3_SiKa_corr_over_Theta_2 = (a/b) #Manipulation D3_SiKa_corr_over_PRESSURE #Variable Mappings a = detector41_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D3_SiKa_corr_over_PRESSURE = (a/b) #Manipulation D4_AlKa_corr #Variable Mappings a = detector45 b = detector64 c = detector65 d = detector67 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D4_AlKa_corr = box if (ICR) == 0: box = 0 D4_AlKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D4_AlKa_corr = box #Manipulation CuKa_sum_cps #Variable Mappings detector25_corr = detector25_corr detector31_corr = detector31_corr detector37_corr = detector37_corr detector43_corr = detector43_corr #TODO: Move, if needed, this import to the file header: import math SUM_DET = 0. SUM_DET = SUM_DET + detector25_corr SUM_DET = SUM_DET + detector31_corr SUM_DET = SUM_DET + detector37_corr SUM_DET = SUM_DET + detector43_corr CuKa_sum_cps = SUM_DET #Manipulation D3_CuKa_corr_over_PRESSURE #Variable Mappings a = detector37_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D3_CuKa_corr_over_PRESSURE = (a/b) #Manipulation D4_SiKa_corr #Variable Mappings a = detector47 b = detector64 c = detector65 d = detector67 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D4_SiKa_corr = box if (ICR) == 0: box = 0 D4_SiKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D4_SiKa_corr = box #Manipulation D2_AlKa_corr #Variable Mappings a = detector33 b = detector54 c = detector55 d = detector57 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D2_AlKa_corr = box if (ICR) == 0: box = 0 D2_AlKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D2_AlKa_corr = box #Manipulation D1_CuKa_corr_over_Theta_2 #Variable Mappings a = detector25_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D1_CuKa_corr_over_Theta_2 = (a/b) #Manipulation D2_SiKa_corr_over_Diode_BM #Variable Mappings a = detector35_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D2_SiKa_corr_over_Diode_BM = (a/b) #Manipulation D2_AlKa_corr_over_Theta_2 #Variable Mappings a = detector33_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D2_AlKa_corr_over_Theta_2 = (a/b) #Manipulation D2_SiKa_corr_over_Theta_2 #Variable Mappings a = detector35_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D2_SiKa_corr_over_Theta_2 = (a/b) #Manipulation D3_CuKa_corr_over_Diode_BM #Variable Mappings a = detector37_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D3_CuKa_corr_over_Diode_BM = (a/b) #Manipulation D1_AlKa_corr_over_Diode_BM #Variable Mappings a = detector27_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D1_AlKa_corr_over_Diode_BM = (a/b) #Manipulation D3_AlKa_corr_over_PRESSURE #Variable Mappings a = detector39_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D3_AlKa_corr_over_PRESSURE = (a/b) #Manipulation D3_TrueICR #Variable Mappings b = detector59 c = detector60 d = detector62 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D3_TrueICR = box if (ICR) == 0: box = 0 D3_TrueICR = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR) <> 0: box = TrueICR if (OCR*d) == 0: box=0.0 D3_TrueICR = box #Manipulation D1_CuKa_corr #Variable Mappings a = detector25 b = detector49 c = detector50 d = detector52 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D1_CuKa_corr = box if (ICR) == 0: box = 0 D1_CuKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D1_CuKa_corr = box #Manipulation D4_CuKa_corr_over_Diode_BM #Variable Mappings a = detector43_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D4_CuKa_corr_over_Diode_BM = (a/b) #Manipulation D3_AlKa_corr_over_Theta_2 #Variable Mappings a = detector39_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D3_AlKa_corr_over_Theta_2 = (a/b) #Manipulation D4_AlKa_corr_over_Diode_BM #Variable Mappings a = detector45_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D4_AlKa_corr_over_Diode_BM = (a/b) #Manipulation D1_CuKa_corr_over_PRESSURE #Variable Mappings a = detector25_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D1_CuKa_corr_over_PRESSURE = (a/b) #Manipulation D1_TrueICR #Variable Mappings b = detector49 c = detector50 d = detector52 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D1_TrueICR = box if (ICR) == 0: box = 0 D1_TrueICR = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR) <> 0: box = TrueICR if (OCR*d) == 0: box=0.0 D1_TrueICR = box #Manipulation D4_CuKa_corr_over_Theta_2 #Variable Mappings a = detector43_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D4_CuKa_corr_over_Theta_2 = (a/b) #Manipulation D1_SiKa_corr #Variable Mappings a = detector29 b = detector49 c = detector50 d = detector52 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D1_SiKa_corr = box if (ICR) == 0: box = 0 D1_SiKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D1_SiKa_corr = box #Manipulation D2_AlKa_corr_over_PRESSURE #Variable Mappings a = detector33_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D2_AlKa_corr_over_PRESSURE = (a/b) #Manipulation D4_SiKa_corr_over_Diode_BM #Variable Mappings a = detector47_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D4_SiKa_corr_over_Diode_BM = (a/b) #Manipulation D4_SiKa_corr_over_PRESSURE #Variable Mappings a = detector47_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D4_SiKa_corr_over_PRESSURE = (a/b) #Manipulation D4_CuKa_corr #Variable Mappings a = detector43 b = detector64 c = detector65 d = detector67 #TODO: Move, if needed, this import to the file header: import math DeadTime = 1.182e-7 ICR = b OCR = c if (OCR) == 0: box = 0 D4_CuKa_corr = box if (ICR) == 0: box = 0 D4_CuKa_corr = box Test = 1.e8 TestICR = ICR n = 0 while ((Test > DeadTime) and (n < 30)): TrueICR = ICR * math.exp(TestICR * DeadTime) Test = (TrueICR - TestICR) / TestICR TestICR = TrueICR n = n + 1 if (OCR*d) <> 0: box = a * TrueICR / OCR / d if (OCR*d) == 0: box=0.0 D4_CuKa_corr = box #Manipulation D4_CuKa_corr_over_PRESSURE #Variable Mappings a = detector43_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D4_CuKa_corr_over_PRESSURE = (a/b) #Manipulation D2_SiKa_corr_over_PRESSURE #Variable Mappings a = detector35_corr b = detector4 #TODO: Move, if needed, this import to the file header: import math D2_SiKa_corr_over_PRESSURE = (a/b) #Manipulation D1_CuKa_corr_over_Diode_BM #Variable Mappings a = detector25_corr b = detector6 #TODO: Move, if needed, this import to the file header: import math D1_CuKa_corr_over_Diode_BM = (a/b) #Manipulation SiKa_sum_cps #Variable Mappings detector29_corr = detector29_corr detector35_corr = detector35_corr detector41_corr = detector41_corr detector47_corr = detector47_corr #TODO: Move, if needed, this import to the file header: import math SUM_DET = 0. SUM_DET = SUM_DET + detector29_corr SUM_DET = SUM_DET + detector35_corr SUM_DET = SUM_DET + detector41_corr SUM_DET = SUM_DET + detector47_corr SiKa_sum_cps = SUM_DET #Manipulation D1_SiKa_corr_over_Theta_2 #Variable Mappings a = detector29_corr b = detector5 #TODO: Move, if needed, this import to the file header: import math D1_SiKa_corr_over_Theta_2 = (a/b) scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9, detector10, detector11, detector12, detector13, detector14, detector15, detector16, detector17, detector18, detector19, detector20, detector21, detector22, detector23, detector24, detector25, detector26, detector27, detector28, detector29, detector30, detector31, detector32, detector33, detector34, detector35, detector36, detector37, detector38, detector39, detector40, detector41, detector42, detector43, detector44, detector45, detector46, detector47, detector48, detector49, detector50, detector51, detector52, detector53, detector54, detector55, detector56, detector57, detector58, detector59, detector60, detector61, detector62, detector63, detector64, detector65, detector66, detector67, detector68, detector69, detector70, detector71, detector72, D2_AlKa_corr_over_Diode_BM, D4_AlKa_corr_over_Theta_2, D2_SiKa_corr, D2_CuKa_corr_over_Diode_BM, D3_CuKa_corr, D3_CuKa_corr_over_Theta_2, D1_SiKa_corr_over_Diode_BM, D4_AlKa_corr_over_PRESSURE, D4_TrueICR, D4_SiKa_corr_over_Theta_2, D2_CuKa_corr_over_PRESSURE, D3_AlKa_corr, D2_TrueICR, D3_SiKa_corr_over_Diode_BM, D2_CuKa_corr_over_Theta_2, D1_AlKa_corr, D3_SiKa_corr, D2_CuKa_corr, D1_SiKa_corr_over_PRESSURE, D1_AlKa_corr_over_PRESSURE, D1_AlKa_corr_over_Theta_2, AlKa_sum_cps, D3_AlKa_corr_over_Diode_BM, D3_SiKa_corr_over_Theta_2, D3_SiKa_corr_over_PRESSURE, D4_AlKa_corr, CuKa_sum_cps, D3_CuKa_corr_over_PRESSURE, D4_SiKa_corr, D2_AlKa_corr, D1_CuKa_corr_over_Theta_2, D2_SiKa_corr_over_Diode_BM, D2_AlKa_corr_over_Theta_2, D2_SiKa_corr_over_Theta_2, D3_CuKa_corr_over_Diode_BM, D1_AlKa_corr_over_Diode_BM, D3_AlKa_corr_over_PRESSURE, D3_TrueICR, D1_CuKa_corr, D4_CuKa_corr_over_Diode_BM, D3_AlKa_corr_over_Theta_2, D4_AlKa_corr_over_Diode_BM, D1_CuKa_corr_over_PRESSURE, D1_TrueICR, D4_CuKa_corr_over_Theta_2, D1_SiKa_corr, D2_AlKa_corr_over_PRESSURE, D4_SiKa_corr_over_Diode_BM, D4_SiKa_corr_over_PRESSURE, D4_CuKa_corr, D4_CuKa_corr_over_PRESSURE, D2_SiKa_corr_over_PRESSURE, D1_CuKa_corr_over_Diode_BM, SiKa_sum_cps, D1_SiKa_corr_over_Theta_2]) #Closing channels Energy.close() EnergyReadback.close() Energy_set.close() Mono_offset.close() I_SLS.close() PRESSURE.close() Theta_2.close() Diode_BM.close() I0_KEITHLEY1.close() KEITHLEY1_GAIN.close() I1_KEITHLEY2.close() KEITHLEY2_GAIN.close() XBPM3_GAIN.close() XBPM3_SAI14_CUR_MEAN.close() XBPM3_SAI15_CUR_MEAN.close() XBPM3_SAI16_CUR_MEAN.close() XBPM3_SAI17_CUR_MEAN.close() XBPM3_POSX.close() XBPM3_POSY.close() XBPM4_GAIN.close() XBPM4_SAI19_CUR_MEAN.close() XBPM4_SAI20_CUR_MEAN.close() XBPM4_SAI21_CUR_MEAN.close() XBPM4_SAI22_CUR_MEAN.close() XBPM4_POSX.close() XBPM4_POSY.close() D1_CuKa.close() D1_CuKa_dxp.close() D1_AlKa.close() D1_AlKa_dxp.close() D1_SiKa.close() D1_SiKa_dxp.close() D2_CuKa.close() D2_CuKa_dxp.close() D2_AlKa.close() D2_AlKa_dxp.close() D2_SiKa.close() D2_SiKa_dxp.close() D3_CuKa.close() D3_CuKa_dxp.close() D3_AlKa.close() D3_AlKa_dxp.close() D3_SiKa.close() D3_SiKa_dxp.close() D4_CuKa.close() D4_CuKa_dxp.close() D4_AlKa.close() D4_AlKa_dxp.close() D4_SiKa.close() D4_SiKa_dxp.close() D1_ICR.close() D1_OCR.close() DD1_ELTM.close() DD1_ERTM.close() DD1_DTIM.close() D2_ICR.close() D2_OCR.close() DD2_ELTM.close() DD2_ERTM.close() DD2_DTIM.close() D3_ICR.close() D3_OCR.close() DD3_ELTM.close() DD3_ERTM.close() DD3_DTIM.close() D4_ICR.close() D4_OCR.close() DD4_ELTM.close() DD4_ERTM.close() DD4_DTIM.close() Spec_1.close() Spec_2.close() Spec_3.close() Spec_4.close() scan.end() #Post-actions caput('X07MB-OP2:START-CSMPL', '1') sleep(0.1) p = subproccess.Popen('/sls/X07MB/data/settings/Scripts/GUI_X07MB/X_X07MB_write_filename_to_file.sh ${FILENAME}' +, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.communicate() ret = p.returncode if ret <> true: raise Exception('Script returned with an exit value not equal to 0') caput('X07MB-OP2:START-CSMPL', '1') sleep(0.1) caput('X07MB-OP-WV1:WT_SET', '0') sleep(0.1)