From 7aff507f60d6d2ffa4075d03355dac875b213888 Mon Sep 17 00:00:00 2001 From: gac-x07ma Date: Fri, 4 Mar 2022 14:47:07 +0100 Subject: [PATCH] Mars 2022 --- config/harmonic_scan_energies.properties | 3 +- config/harmonic_scan_offsets.properties | 111 +++++++++-------- config/scicat.properties | 12 +- config/session_metadata.properties | 0 config/sessions.properties | 4 +- config/settings.properties | 2 +- config/variables.properties | 8 +- script/EnergyScan_topup.py | 146 +++++++++++++++++++++++ script/EnergyScan_v2.py | 10 +- script/HorizontalScan_infocus.py | 27 +++-- script/HorizontalScan_out_of_focus.py | 52 ++++---- script/HystScan.py | 7 +- script/HystScanStep.py | 3 +- script/HystScan_ESR.py | 8 +- script/I01_scan.py | 2 +- script/TimeScan_ESR.py | 26 ++-- script/VerticalScan.py | 59 +++++---- script/harmonic_v2.py | 2 +- script/local.py | 90 +++++++++----- script/refill_1kpot.py | 6 +- script/restore/local.py | 4 +- script/test/TimeScanEnergy.py | 33 +++++ script/test/test.py | 2 +- script/{ => unused}/EnergyScan.py | 15 ++- 24 files changed, 457 insertions(+), 175 deletions(-) mode change 100644 => 100755 config/scicat.properties mode change 100644 => 100755 config/session_metadata.properties mode change 100644 => 100755 config/sessions.properties create mode 100644 script/EnergyScan_topup.py mode change 100755 => 100644 script/restore/local.py create mode 100644 script/test/TimeScanEnergy.py rename script/{ => unused}/EnergyScan.py (91%) diff --git a/config/harmonic_scan_energies.properties b/config/harmonic_scan_energies.properties index b5f8a3f..6459f8f 100755 --- a/config/harmonic_scan_energies.properties +++ b/config/harmonic_scan_energies.properties @@ -1,3 +1,5 @@ +Nd=1003.3 +Mg=1310.0 F=695.0 Gd=1189.0 Ba=790.0 @@ -19,7 +21,6 @@ Ni=852.0 O=543.0 Sm=1110.0 V=520.0 -W_M45=1850.0 Tb=1250.0 Ti=460.0 Zn=1020.0 diff --git a/config/harmonic_scan_offsets.properties b/config/harmonic_scan_offsets.properties index 9ac4cdd..f4bae51 100755 --- a/config/harmonic_scan_offsets.properties +++ b/config/harmonic_scan_offsets.properties @@ -1,83 +1,92 @@ -#Tue Aug 31 22:33:17 CEST 2021 -Ni-C+=1.0 31.08.21 22\:27 +#Mon Feb 28 11:55:31 CET 2022 +Ni-C+=1.0 06.02.22 15\:42 W_M45-C-=1.0 26.04.21 15\:51 -Cu-C-=4.0 18.08.21 09\:09 -Cu-C+=3.0 18.08.21 09\:07 -Zn-LV=-8.0 19.04.21 10\:05 -V-C-=0.5 19.08.21 20\:31 -Ni-C-=2.0 31.08.21 22\:30 +N-C+=-0.5 28.11.21 22\:28 +Mg-LH=6.5 21.10.21 14\:15 +Cu-C-=3.0 24.01.22 11\:16 +Zn-LV=3.0 28.02.22 11\:55 +Cu-C+=3.5 28.02.22 11\:36 +V-C-=1.0 23.02.22 09\:10 +Ni-C-=2.0 06.02.22 15\:47 Ho-C+=-5.0 08.03.21 00\:56 -Co-LV=3.5 20.08.21 11\:56 +Co-LV=3.5 14.12.21 17\:47 Al-LV=-10.0 19.04.21 09\:56 Er-LV=6.0 24.04.21 13\:44 -Gd-C-=-1.0 12.06.21 18\:19 -Gd-C+=-4.5 12.06.21 18\:22 -Ti-LV=2.0 16.08.21 14\:38 -Dy-C+=-4.5 05.03.21 15\:58 +Gd-C-=-1.0 17.12.21 09\:23 +N-C-=-1.0 03.02.22 16\:33 +Gd-C+=-3.5 17.12.21 17\:23 +Mg-LV=6.5 20.10.21 20\:27 +Ti-LV=2.0 24.02.22 10\:19 +Dy-C+=-3.0 07.12.21 22\:56 Dy-C-=-1.0 27.01.21 02\:56 Ho-C-=0.0 08.03.21 00\:57 -Eu-LH=5.0 06.11.20 15\:11 -O-LH=2.5 23.06.21 10\:43 -Cr-LH=2.3 23.09.20 13\:31 +Eu-LH=4.0 24.02.22 10\:28 +O-LH=3.0 07.12.21 22\:27 +Cr-LH=2.5 03.11.21 02\:09 W_M45-C+=-1.0 26.04.21 15\:49 -Cr-C+=0.0 11.06.21 13\:17 -O-C+=-0.5 19.04.21 09\:41 -Fe-LH=2.5 31.08.21 17\:44 -Eu-LV=6.5 22.10.20 15\:02 -Tb-C-=-1.5 21.06.21 09\:51 +Cr-C+=-0.5 04.11.21 11\:54 +O-C+=3.0 20.09.21 01\:51 +Fe-LH=3.0 02.02.22 09\:48 +Eu-LV=4.5 24.02.22 10\:30 +Tb-C-=0.5 19.09.21 04\:59 W-C-=1.0 22.04.21 09\:51 -Tb-C+=-5.0 28.08.21 20\:19 +Tb-C+=-3.5 19.09.21 05\:00 Ce-C-=3.5 20.08.21 14\:20 -Cr-C-=1.5 11.06.21 13\:18 -O-C-=1.5 19.04.21 09\:43 +Cr-C-=1.0 04.11.21 11\:52 +O-C-=4.5 20.09.21 01\:49 Ce-C+=2.5 20.08.21 14\:23 Ge-LV=6.0 09.09.20 14\:22 -Fe-LV=3.0 31.08.21 17\:45 -Zn-LH=4.5 01.06.21 21\:25 -V-C+=-1.0 19.08.21 09\:43 +Fe-LV=3.0 02.02.22 09\:50 +Zn-LH=3.0 28.02.22 11\:54 +V-C+=-1.0 24.01.22 11\:24 Sm-C+=-5.0 20.08.21 14\:29 -Mn-C-=2.0 15.08.21 20\:37 -Mn-C+=-0.5 19.08.21 20\:32 +Mn-C-=1.0 23.01.22 11\:26 +Mn-C+=-1.5 23.01.22 11\:24 Ge-LH=6.0 09.09.20 14\:19 Sm-C-=-1.5 08.09.20 21\:19 -Co-LH=3.5 20.08.21 11\:57 -Cu-LV=6.0 23.06.21 13\:14 +Co-LH=3.5 14.12.21 17\:46 +Cu-LV=4.5 28.02.22 11\:39 Zn-C-=10.0 19.04.21 10\:02 -V-LV=3.0 28.06.21 10\:08 -Ni-LV=3.0 31.08.21 22\:33 +V-LV=2.0 23.02.22 19\:29 +Ni-LV=4.0 02.11.21 19\:47 Zn-C+=7.5 19.04.21 09\:59 Er-C+=-4.0 18.10.20 10\:34 -Co-C-=2.5 20.08.21 12\:03 +Co-C-=2.5 14.12.21 17\:44 Er-C-=3.0 17.10.20 10\:50 -Co-C+=1.0 20.08.21 11\:59 +Co-C+=1.0 14.12.21 17\:43 Ho-LH=7.0 11.03.21 02\:17 C-LV=2.5 06.05.21 03\:41 -N-LV=2.0 23.06.21 13\:11 -Ti-C+=-0.5 05.05.21 11\:55 -Ti-C-=0.5 05.05.21 12\:01 -Ni-LH=3.0 31.08.21 22\:32 +N-LV=1.5 28.02.22 11\:50 +Ti-C+=-0.5 24.02.22 10\:21 +Ti-C-=0.5 24.02.22 10\:22 +Ni-LH=4.0 02.11.21 19\:46 W-C+=-0.5 22.04.21 09\:53 -Dy-LV=6.0 30.01.21 18\:02 +Dy-LV=6.5 07.12.21 22\:52 +Nd-C-=-2.5 24.09.21 15\:05 Ho-LV=7.0 11.03.21 02\:19 C-LH=2.0 06.05.21 03\:39 Ge-C+=-5.0 09.09.20 14\:23 -Dy-LH=6.5 05.03.21 23\:04 -Ti-LH=2.0 16.08.21 14\:34 -Eu-C-=-0.5 21.04.21 17\:18 -Mn-LH=2.5 19.08.21 20\:35 -Eu-C+=-5.0 21.04.21 17\:20 +Dy-LH=6.5 07.12.21 22\:54 +Ti-LH=2.0 24.02.22 10\:17 +Ba-LH=5.0 07.12.21 22\:25 +Eu-C-=-2.0 24.02.22 10\:25 +Nd-C+=-4.5 03.11.21 04\:46 +Mn-LH=1.5 23.01.22 11\:20 +Eu-C+=-5.5 24.02.22 10\:27 Ce-LV=4.0 20.08.21 14\:27 Sm-LH=4.0 20.08.21 10\:55 -O-LV=2.5 23.06.21 10\:42 +O-LV=3.0 07.12.21 22\:29 +Cr-LV=2.5 03.11.21 02\:10 Ge-C-=0.0 09.09.20 14\:24 -Fe-C-=1.5 31.08.21 20\:44 -Cu-LH=6.5 23.06.21 13\:15 -V-LH=3.0 28.06.21 10\:06 +Fe-C-=2.0 02.02.22 09\:47 +Cu-LH=4.5 28.02.22 11\:37 +V-LH=2.0 23.02.22 19\:27 +Ba-LV=5.5 07.12.21 22\:23 Ce-LH=4.5 20.08.21 14\:25 -Mn-LV=2.5 15.08.21 20\:31 +Mn-LV=1.5 23.01.22 11\:22 Er_C+=-4.3 30.06.20 21\:58 Al-LH=10.0 19.04.21 09\:55 Er-LH=6.0 24.04.21 13\:43 Sm-LV=4.0 20.08.21 10\:57 -Fe-C+=-0.5 31.08.21 20\:45 -N-LH=2.0 23.06.21 13\:08 +Fe-C+=0.0 02.02.22 09\:43 +N-LH=1.5 28.02.22 11\:52 diff --git a/config/scicat.properties b/config/scicat.properties old mode 100644 new mode 100755 index e8077b1..8078e92 --- a/config/scicat.properties +++ b/config/scicat.properties @@ -1,10 +1,10 @@ -#Tue Aug 31 11:31:23 CEST 2021 +#Tue Oct 19 11:57:18 CEST 2021 environment=prod -testParameters=-testenv -user slssim\:slssim -sourceFolder=/sls/X07MA/Data1/x07maop -prodParameters=\ -user slssim\:slssim -devParameters=-devenv -user slssim\:slssim -ownerGroup=P1000 +testParameters=-testenv -user slsxtreme\:kyzWxAfqu6 +sourceFolder=/sls/X07MA/Data1/e19389 +prodParameters=\ -user slsxtreme\:kyzWxAfqu6 +devParameters=-devenv -user slsxtreme\:kyzWxAfqu6 +ownerGroup= type=raw parameters=-ingest -allowexistingsource -noninteractive -autoarchive creationLocation=/PSI/SLS/XTREME diff --git a/config/session_metadata.properties b/config/session_metadata.properties old mode 100644 new mode 100755 diff --git a/config/sessions.properties b/config/sessions.properties old mode 100644 new mode 100755 index 07b0943..c600398 --- a/config/sessions.properties +++ b/config/sessions.properties @@ -1,2 +1,2 @@ -#Tue Aug 31 11:40:30 CEST 2021 -SessionCounter=3 +#Tue Oct 19 11:55:58 CEST 2021 +SessionCounter=6 diff --git a/config/settings.properties b/config/settings.properties index 07c6e39..b7579da 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,2 +1,2 @@ -#Tue Aug 31 15:35:20 CEST 2021 +#Thu Nov 04 12:26:22 CET 2021 FdaBrowser=false diff --git a/config/variables.properties b/config/variables.properties index 5ad7c21..366a88d 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,5 +1,5 @@ -#Wed Sep 01 10:20:33 CEST 2021 -LastRunDate=210901 +#Mon Feb 28 18:57:33 CET 2022 +LastRunDate=220228 SessionCounter=0 -FileSequentialNumber=13754 -DaySequentialNumber=14 +FileSequentialNumber=17477 +DaySequentialNumber=98 diff --git a/script/EnergyScan_topup.py b/script/EnergyScan_topup.py new file mode 100644 index 0000000..882501e --- /dev/null +++ b/script/EnergyScan_topup.py @@ -0,0 +1,146 @@ +''' +#Parameters +E1 = 630 +E2 = 685 +TIME = 1 #min +DELAY = 0.0 #s +MODE = 'LINEAR' #'CIRC +' +OFFSET = None +FOLDER = '2021_03/20210330' +FILE = 'Test' +ALPHA=0 #None +''' + +set_exec_pars (reset=True) +print "wait 0.5 seconds..." +time.sleep(0.5) # delay to avoid immediate commands to ID after completion of last scan + +#print "\nCheck temperature" +#wait_temp() +#print "\nTemperature ok" + +print "\nStart energy scan..." +#print E1,E2,TIME,DELAY,str(MODE) ,str(OFFSET) ,str(FOLDER) ,str(FILE) ,str(ALPHA) +if MODE == "LINEAR": + print E1,"eV ->",E2,"eV,",TIME,"min duration,",DELAY,"sec delay,",str(MODE),str(ALPHA),"deg" +else: + print E1,"eV ->",E2,"eV,",TIME,"min duration,",DELAY,"sec delay,",str(MODE) + +folder = os.path.expanduser("~/Data1/") + FOLDER + "/"; +set_exec_pars(name= FILE) + +#Pre-actions +if NO_BEAM_CHECK == False: + print "Wait beam" + wait_beam() + + +if MODE is not None: + print "Set polarization" + pol_mode.write(MODE) + if MODE == 'LINEAR': + if ALPHA is not None: + pol_angle.write(ALPHA) + wait_pol_done(1.0) # new script to wait for polarization. Wait_device does not work for this channel + +print "Set Energy" +if OFFSET is not None: + pol_offset.write(OFFSET) #TODO: CAPUT + #time.sleep(0.5) + #wait_device(pol_done, "DONE") + +energy.write(float(E1)) # no need to add wait command. This commands sets and waits. +print "Energy setting done" +caput('X07MA-PGM:CERBK.N',10) # set energy readback averaging to 10 pts + +caput('E1', E1) +caput('E2', E2) +caput('TIME', TIME) +#caput('FOLDER', FOLDER) +caput('FOLDER', "OTF/" + FOLDER) +caput('FILE', FILE) +time.sleep(0.1) + +#open_valve() +#open_valve(0.0) #TODO: WHY WRITING AGAIN??? +time.sleep(DELAY) + +#if WAIT_STABLE_TEMPERATURE == True: +# wait_temp() + +topup_thresh=402.1 +print('wait for topup') +while(caget('ARIDI-PCT:CURRENT') < topup_thresh): + sleep(0.3) + pass; +print('topup done') + + +scan_completed = False + +try: + while True: # if ABORT_ON_ID_ERROR == False, waits reading with no ID error + caput('START', '1') + + write_logs() + + waiting = True + + class Time(Readable): + def __init__(self): + self.start = time.time() + def read(self): + return time.time()-self.start + + class NORMtey(Readable): + def read(self): + return float(CADC1.take())/float(CADC2.take()) + + class NORMdiode(Readable): + def read(self): + return float(CADC3.take())/float(CADC2.take()) + + pol = pol_angle if (pol_mode.readback.read() == "LINEAR") else pol_mode #Fixed, should be an attribute, not a column + sensors = [Ecrbk, CADC1, CADC2, CADC3,CADC4,CADC5,current,Time(),FieldX,FieldZ,pol, Temperature, NORMtey(), NORMdiode()] + + def monitoring_task(): + global scan_completed + time.sleep(1.0) + try: + plot_titles = ["TEY raw", "I0", "diode_raw", "TEY_norm", "diode_norm"] + for index, title in enumerate(plot_titles, start=0): get_plots()[index].title = title + except: + pass + wait_channel('START', 'STOP', type = 's') + scan_completed = True + get_exec_pars().currentScan.abort() + + ret = fork(monitoring_task) + current.alias="MCurr" + pol.alias="Pol" + + print "Scanning...", + + try: + mscan(Ecrbk, sensors, -1, None, range="auto", domain_axis="Ecrbk", enabled_plots = ["NORMtey", "NORMdiode", CADC1,CADC3, CADC2], ) + finally: + ret[0].cancel(True) + current.alias=None + pol.alias=None + + #time.sleep(2.0) + + print "Finished Energy scan." + if after_sample(): #Repeat if id error + break + +except: + if not scan_completed: + print sys.exc_info() + print("Aborting...") + while caget('START') == 'START': + caput('START', '0') + time.sleep(0.1) + #if get_exec_pars().source != CommandSource.plugin: + # show_message(str(ex)) + raise diff --git a/script/EnergyScan_v2.py b/script/EnergyScan_v2.py index 452425e..08f940f 100644 --- a/script/EnergyScan_v2.py +++ b/script/EnergyScan_v2.py @@ -12,6 +12,12 @@ ALPHA=0 #None ''' set_exec_pars (reset=True) +print "wait 0.5 seconds..." +time.sleep(0.5) # delay to avoid immediate commands to ID after completion of last scan + +#print "\nCheck temperature" +#wait_temp() +#print "\nTemperature ok" print "\nStart energy scan..." #print E1,E2,TIME,DELAY,str(MODE) ,str(OFFSET) ,str(FOLDER) ,str(FILE) ,str(ALPHA) @@ -35,9 +41,7 @@ if MODE is not None: if MODE == 'LINEAR': if ALPHA is not None: pol_angle.write(ALPHA) - time.sleep(0.5) # TIME SLEEP IS NECESSARY. OTHERWISE NEXT COMMAND WILL NOT WAIT FOR POLARIZATION SETTING. ADDED BY CP ON 07.02.2020 - wait_device(pol_done, "DONE") # Oct. 2019 added wait to try avoid taper error - print "Polarization setting done" + wait_pol_done(1.0) # new script to wait for polarization. Wait_device does not work for this channel print "Set Energy" if OFFSET is not None: diff --git a/script/HorizontalScan_infocus.py b/script/HorizontalScan_infocus.py index fd94ce6..83841d8 100644 --- a/script/HorizontalScan_infocus.py +++ b/script/HorizontalScan_infocus.py @@ -1,25 +1,32 @@ +open_valve() ##################### ## INPUT PARAMETERS## -POS_START = 157 #Minn = 150.0 -POS_END = 163 #Max = 170.0 -POS_STEP = 0.05 +POS_START = 157.5 #Minn = 150.0 +POS_END = 165 #Max = 170.0 +POS_STEP = 0.25 SETTLING_TIME = 0.1 - +#ENERGIES = [543] # O +#ENERGIES = [461] # Ti +#ENERGIES = [1611] # Tb +#ENERGIES = [1190] # Gd +#ENERGIES = [570.0]#, 577.0] # Cr +#ENERGIES = [461] #Ti #ENERGIES = [363.2, 356.0]# Nb -#ENERGIES = [774. 0] # Co -#ENERGIES = [573.0, 577.0] # Cr +#ENERGIES = [778.0,778.3] # Co #ENERGIES = [708.3,704.0] # Fe -#ENERGIES = [931.7]# 925.0 ] # Cu +#ENERGIES = [931.7, 925.0 ] # Cu #ENERGIES = [928.4] #Cu #ENERGIES = [928.4, 707.5] #Cu Fe, special #ENERGIES = [572.0] #ENERGIES = [706]#,708.3,704.0] # Fe -#ENERGIES = [851.3 ,845]#[851.2,848.0] # Ni +#ENERGIES = [851.3 ,845] +#ENERGIES = [851.2,848.0] # Ni #ENERGIES = [280,292] #C -#ENERGIES = [776.9,774] # Co -ENERGIES = [639.5,630.0] # Mn +#ENERGIES = [776.7,774] # Co +#ENERGIES = [639.5,630.0] # Mn +ENERGIES = [459.7,456] #Ti #ENERGIES = [1067, 1076.4 ] # Sm #ENERGIES = [870, 880.3 ] # Ce #ENERGIES = [516.0, 503.0] # V diff --git a/script/HorizontalScan_out_of_focus.py b/script/HorizontalScan_out_of_focus.py index 01fb07d..f58a190 100644 --- a/script/HorizontalScan_out_of_focus.py +++ b/script/HorizontalScan_out_of_focus.py @@ -1,18 +1,21 @@ ##################### ## INPUT PARAMATERS## -#open_valve() #X07MA-ES1-SHUTTER:TRZ1.VAL #POS_START = 107 #Min = 98.0 #POS_END = POS_START + 6 #Max = 118.0 #caput("X07MA-ES1-SHUTTER:TRZ1.VAL", POS_START - 108.0 + 40.5) -POS_START = 108.5 #Min = 98.0 -POS_END = 110.5 #Max = 118.0 -POS_STEP = 0.01 +POS_START = 98 #Min = 98.0 +POS_END = 114 #Max = 118.0 +POS_STEP = 0.2 SETTLING_TIME = 0.0 +#POS_START = 100 #Min = 98.0 +#POS_END = 117 #Max = 118.0 +#POS_STEP = 0.25 + #caput("X07MA-ES1-SHUTTER:TRZ1.VAL", POS_START - 108.0 + 40.5) #36: 106.25 @@ -27,8 +30,11 @@ SETTLING_TIME = 0.0 #Max = 118.0 #POS_STEP = 0.1 #""" - -#ENERGIES = [458.4,454] #Ti +ENERGIES = [929.2,920] # test +#ENERGIES = [774.0,779.5] # Co +#ENERGIES = [776.0,778.0] # Co +#ENERGIES = [459.7,456] #Ti +#ENERGIES = [1128, 1120 ]# Eu #ENERGIES = [285.3, 280.0]# C #ENERGIES = [1030,1015] #Zn #ENERGIES = [485.0,490.0] # Ru @@ -45,22 +51,22 @@ SETTLING_TIME = 0.0 #ENERGIES = [385.0]# C #ENERGIES = [570.0,576.3] #Cr #ENERGIES = [1850, 1820]# Si -#ENERGIES = [530] #O +#ENERGIES = [532.3, 525.0] #O #ENERGIES = [397.7,392] # Pc #ENERGIES = [399.1,392] # TCNQ -#ENERGIES = [700] #Ti -#ENERGIES = [638.8,633.0] # Mn +#ENERGIES = [459.7,456] #Ti +#ENERGIES = [639.0] # Mn +#ENERGIES = [848.5, 842.0] # La #ENERGIES = [463,457] -#ENERGIES = [638.8,636.6] # Mn -#ENERGIES = [707., 704.] # Fe +#ENERGIES = [639.1,636.6] # Mn +#ENERGIES = [707.0, 704.0] # Fe #ENERGIES = [708.3] -ENERGIES = [928.4] #CuO -#ENERGIES = [927, 929] #Cu -#ENERGIES = [929.5, 925] #Cu +#ENERGIES = [928.4] #CuO +#ENERGIES = [929.0, 925.0] #Cu #ENERGIES = [927, 929] #Cu #ENERGIES = [402, 397] # Ta -#ENERGIES = [777., 774.0] # Co -#ENERGIES = [783.15,774] # Ba +#ENERGIES = [777.3, 774.0] # Co +#ENERGIES = [782.5,775] # Ba #ENERGIES = [778] # Co #ENERGIES = [848.5, 842] # La #ENERGIES = [465.0,450.0] # STO @@ -69,7 +75,7 @@ ENERGIES = [928.4] #CuO #ENERGIES = [1235.0, 1228.0 ] #Er? Dy? #ENERGIES = [1067, 1076 ] # Sm #ENERGIES = [ 1185 ] # Gd -#ENERGIES = [1300, 1312 ] # Mg +#ENERGIES = [1300, 1312] # Mg #ENERGIES = [1457.8] # Tm #ENERGIES = [1344.2, 1346 ] # Ho #ENERGIES = [1400.5,1395.0] #Er @@ -77,23 +83,23 @@ ENERGIES = [928.4] #CuO #ENERGIES = [385] # N #ENERGIES = [1563.0,1555.0] # Al #ENERGIES = [1456.9, 1450 ] # Tm -#ENERGIES = [931.7, 925.0] # Cu metal +#ENERGIES = [928.5, 925.0] # Cu metal #ENERGIES = [920.0 ] # Cu1 -#ENERGIES = [708.6, 704] # Fe +#ENERGIES = [706.5, 704] # Fe #ENERGIES = [706.6, 704] # Fe metal -#ENERGIES = [706.6] +#ENERGIES = [700.0] #ENERGIES = [352, 340.0] # Ca -#ENERGIES = [1125.4, 1120] # Eu +#ENERGIES = [1126.16, 1120] # Eu #ENERGIES = [696.7, 680.0] # F #ENERGIES = [692.0] # F #ENERGIES = [782.50, 775.0] # Ba #ENERGIES = [782.50] # Ba -#ENERGIES = [1289.5, 1282.0] # Dy +#ENERGIES = [1289.4] # Dy #ENERGIES = [660.0, 665.0] # In #ENERGIES = [1850, 1820]# Si #ENERGIES = [1125.6]# Eu #ENERGIES = [850.9, 842] # Ni -#ENERGIES = [517.5, 510] # V +#ENERGIES = [514.1, 510] # V #ENERGIES = [1455,1420] # Se #ENERGIES = [1181.0,1173.0] #ENERGIES = [285.3, 280.0]# C diff --git a/script/HystScan.py b/script/HystScan.py index d468ec3..fca682e 100644 --- a/script/HystScan.py +++ b/script/HystScan.py @@ -47,7 +47,9 @@ print "OK" # ramp_rate.write(RAMP_RATE) # ramp_rate.waitInPosition(RAMP_RATE,10000) - +print "Check temperature" +wait_temp() +print "Temperature ok" if len(ENERGIES) ==2: # dif_series = plot([],"Dif", get_context()="Dif")[0].getSeries(0) @@ -128,7 +130,8 @@ sleep( ENERGY_CHANGE_SLEEP ) # Settling time wait_device(energy_done, 1 ) -wait_device(pol_done, "DONE") +#wait_device(pol_done, "DONE") +wait_pol_done(1.0) #if WAIT_STABLE_TEMPERATURE == True: diff --git a/script/HystScanStep.py b/script/HystScanStep.py index 4abb7c7..93d6c3a 100644 --- a/script/HystScanStep.py +++ b/script/HystScanStep.py @@ -21,7 +21,8 @@ if MODE is not None: if OFFSET is not None: pol_offset.write(OFFSET) #caput('X07MA-ID:ENERGY-OFFS', OFFSET) -wait_device(pol_done,"DONE", -1) +#wait_device(pol_done,"DONE", -1) +wait_pol_done(1.0) setpoints = [] for r in RANGES: diff --git a/script/HystScan_ESR.py b/script/HystScan_ESR.py index 929d058..0325296 100644 --- a/script/HystScan_ESR.py +++ b/script/HystScan_ESR.py @@ -118,11 +118,13 @@ print "Set energy..." setpoint2 = ENERGIES[0] print setpoint2 energy.write(setpoint2) -sleep( ENERGY_CHANGE_SLEEP ) # Settling time +# 2022: comment out, since write apparantly already waits for it to finish +#sleep( ENERGY_CHANGE_SLEEP ) # Settling time -wait_device(energy_done, 1 ) +#wait_device(energy_done, 1 ) -wait_device(pol_done, "DONE") +#wait_device(pol_done, "DONE") +wait_pol_done(1.0) # 2022: new script to wait for polarization. Wait_device does not work for this channel # new mid 2021: monitor the UW reflected power act_stamp = time.strftime('%Y%m%d_%H%M%S') + '_' diff --git a/script/I01_scan.py b/script/I01_scan.py index 2c66fc6..a28c14e 100644 --- a/script/I01_scan.py +++ b/script/I01_scan.py @@ -6,7 +6,7 @@ POS_STEP = 0.5 #ENERGIES = [704.0,708.7] # Fe -ENERGIES = [530] # +ENERGIES = [460] # ##################### diff --git a/script/TimeScan_ESR.py b/script/TimeScan_ESR.py index 3812243..57ea105 100644 --- a/script/TimeScan_ESR.py +++ b/script/TimeScan_ESR.py @@ -125,11 +125,14 @@ print "Set energy..." setpoint2 = ENERGIES[0] print setpoint2 energy.write(setpoint2) -sleep( ENERGY_CHANGE_SLEEP ) # Settling time +# 2022: comment out, since write apparantly already waits for it to finish +#sleep( ENERGY_CHANGE_SLEEP ) # Settling time -wait_device(energy_done, 1 ) - -wait_device(pol_done, "DONE") +#wait_device(energy_done, 1 ) +print "done energy" +#wait_device(pol_done, "DONE") +wait_pol_done(1.0) # 2022: new script to wait for polarization. Wait_device does not work for this channel +print "done pol" #if WAIT_STABLE_TEMPERATURE == True: @@ -163,8 +166,10 @@ while(True): #Energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout energy.write(setpoint2) sleep( ENERGY_CHANGE_SLEEP ) # Settling time - else: - sleep( 0.25 ) # TODO: Check + else: + #pass + #sleep( 0.25 ) # TODO: Check + sleep( 0.3 ) # TODO: Check #TODO: change to Controlled variable? readback2 = energy_readback.read() #EnergyReadback.get() @@ -185,7 +190,14 @@ while(True): detector4 = pol_mode_buffer #float(pol_mode.getPositions().index(pol_mode.readback.read())) #polarization.get() detector5 = pol_angle_buffer #pol_angle.read() #polAngle.get() detector6 = temperature.readback.read() #temperature.get() - detector7 = current.read() + # once in a single time, there was an error in a script related to this command, namely + # Error creating channel: ARIDI-PCT:CURRENT [current] in