This commit is contained in:
gac-x07ma
2020-04-22 14:35:07 +02:00
parent a72079f33c
commit f3f1471a72
13 changed files with 101 additions and 34 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ dataScanPreserveTypes=false
logLevel=Fine
dataScanFlushRecords=true
logPath={logs}/{date}_{time}
dataLayout=ch.psi.fda.LayoutFDA
dataLayout=fda
deviceUpdateStrategyFile={config}/update.properties
terminalEnabled=true
notificationLevel=Error
@@ -36,5 +36,5 @@ createSessionFiles=false
versionTrackingLogin={context}/svcusr-hlapp_robot
scriptType=py
versionTrackingRemote=git@git.psi.ch\:pshell_config/x07ma.git
dataProvider=ch.psi.fda.ProviderFDA
dataProvider=fda
saveCommandStatistics=false
+1 -1
View File
@@ -5,5 +5,5 @@ host=smtpint.psi.ch
port=0
pwd=
smsSuffix=@sms.switch.ch
to=jan.dreiser@psi.ch
to=vladyslav.romankov@psi.ch
usr=
+9
View File
@@ -0,0 +1,9 @@
#Thu Nov 09 14:04:03 CET 2017
auth=None
from=X07MA-pshell@psi.ch
host=smtpint.psi.ch
port=0
pwd=
smsSuffix=@sms.switch.ch
to=jan.dreiser@psi.ch
usr=
+9
View File
@@ -0,0 +1,9 @@
#Thu Nov 09 14:04:03 CET 2017
auth=None
from=X07MA-pshell@psi.ch
host=smtpint.psi.ch
port=0
pwd=
smsSuffix=@sms.switch.ch
to=XXXXX
usr=
+9
View File
@@ -0,0 +1,9 @@
#Thu Nov 09 14:04:03 CET 2017
auth=None
from=X07MA-pshell@psi.ch
host=smtpint.psi.ch
port=0
pwd=
smsSuffix=@sms.switch.ch
to=jon.dreiser@psi.ch
usr=
+2 -2
View File
@@ -1,2 +1,2 @@
#Tue Mar 17 08:18:17 CET 2020
FileSequentialNumber=3172
#Sun Apr 19 01:15:13 CEST 2020
FileSequentialNumber=3724
+19 -6
View File
@@ -1,5 +1,5 @@
#Script imported from: MgE_plus.xml
INVOKE_PLOT_UPDATES = True
#Parameters
"""
@@ -25,6 +25,13 @@ def start_plot():
global p
p = plot([None, None, None,None, None], ["TEY", "TFY", "TEYraw", "TFYraw", "I0"])
def _update_plots(p, x, s0, s1, s2, s3, s4):
p[0].getSeries(0).setData(x, s0)
p[1].getSeries(0).setData(x, s1)
p[2].getSeries(0).setData(x, s2)
p[3].getSeries(0).setData(x, s3)
p[4].getSeries(0).setData(x, s4)
def update_plot():
global p
c = count.take()
@@ -44,11 +51,16 @@ def update_plot():
l = lambda x,y: (0.0 if (y==0.0) else x/y) #truediv
tey=map(l, teyr, i0)
tfy=map(l, tfyr, i0)
p[0].getSeries(0).setData(x, to_array(tey,'d'))
p[1].getSeries(0).setData(x, to_array(tfy,'d'))
p[2].getSeries(0).setData(x, to_array(teyr,'d'))
p[3].getSeries(0).setData(x, to_array(tfyr,'d'))
p[4].getSeries(0).setData(x, to_array(i0,'d'))
args = [ p, x, to_array(tey,'d'),
to_array(tfy,'d'),
to_array(teyr,'d'),
to_array(tfyr,'d'),
to_array(i0,'d')]
if INVOKE_PLOT_UPDATES:
invoke([_update_plots, args])
else:
_update_plots(*args)
"""
#open shutter
@@ -208,6 +220,7 @@ try:
raise Exception("Data file not found: " + name)
convert_file(name, newName)
log_scan_filename(newName)
#mail
#plot_file(newName)
#print("Success")
+13 -11
View File
@@ -1,16 +1,16 @@
#####################
## INPUT PARAMATERS##
#open_valve()
POS_START = 102 #Min = 98.0
POS_END = 112 #Max = 118.0
POS_STEP = 0.5
POS_START = 104 #Min = 98.0
POS_END = 114 #Max = 118.0
POS_STEP = 0.25
"""
POS_START =106 #Min = 98.0
POS_END = 108.7
#"""
#POS_START =106 #Min = 98.0
#POS_END = 108.7
#Max = 118.0
POS_STEP = 0.1
"""
#POS_STEP = 0.1
#"""
#ENERGIES = [1344.5, 1338] # Ho edge, pre-edge
#ENERGIES = [1289.5, 1280] # Dy edge, pre-edge
#ENERGIES = [459,455] #Ti
@@ -30,8 +30,10 @@ POS_STEP = 0.1
#ENERGIES = [642.0,630.0] # Mn
#ENERGIES = [463,457]
#ENERGIES = [637.8,638.9,640.1,636.0] # Mn
ENERGIES = [700.0] # Fe
#ENERGIES = [700.0] # Fe
#ENERGIES = [928.2, 925] #CuO
#ENERGIES = [931.7, 925] #Cu
#ENERGIES = [929] #Cu
#ENERGIES = [402, 397] # Ta
#ENERGIES = [777.3,774] # Co
#ENERGIES = [778] # Co
@@ -50,11 +52,11 @@ ENERGIES = [700.0] # Fe
#ENERGIES = [385] # N
#ENERGIES = [1563.0,1555.0] # Al
#ENERGIES = [1456.9, 1450 ] # Tm
#ENERGIES = [928.3, 925.0] # Cu metal
#ENERGIES = [931.7, 925.0] # Cu metal
#ENERGIES = [928.4 ] # Cu1
#ENERGIES = [700.0, 708.0] # Fe
#ENERGIES = [696.7, 680.0] # F
#ENERGIES = [692.0] # F
ENERGIES = [692.0] # F
#ENERGIES = [782.50, 775.0] # Ba
#ENERGIES = [782.50] # Ba
#ENERGIES = [1289, 1280] # Dy edge
+1
View File
@@ -84,3 +84,4 @@ for setpoint1 in setpoints:
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, _tey_norm, _trans_norm])
after_sample() #To call check_id_error()
scan.end()
log_scan_filename()
+1 -1
View File
@@ -131,5 +131,5 @@ while(True):
index = index+1
scan.end()
log_scan_filename()
close_valve()
+13 -5
View File
@@ -1,7 +1,11 @@
#####################
## INPUT PARAMETERS##
POS_START = 12
POS_END = 20
#POS_START = 5
#POS_END = 25
#POS_STEP = 0.5
POS_START = 9
POS_END = 18
POS_STEP = 0.5
#ENERGIES = [532, 523]# O
@@ -15,16 +19,19 @@ POS_STEP = 0.5
#ENERGIES = [696.5, 680.0] # F
#ENERGIES = [1110,1125.5] #STO
#ENERGIES = [397.7,392] # Pc
#ENERGIES = [700.0, 708.0] # Fe
ENERGIES = [700.0]#, 708.0] # Fe
#ENERGIES = [530] #O
ENERGIES = [700.0] #Fe
#ENERGIES = [700.0] #Fe
#ENERGIES = [931.7, 925] #Cu
#ENERGIES = [928.2, 925] #CuO
#ENERGIES = [929] #Cu
#ENERGIES = [774.0] # Co
#ENERGIES = [777.3, 774.0] # Co
#ENERGIES = [851.3,842.0] # Ni
#ENERGIES = [576.4, 560.0] #Cr
#ENERGIES = [485.0,490.0] # Ru
#ENERGIES = [642.0,630.0] # Mn
#ENERGIES = [638.5,630.0] # Mn
#ENERGIES = [465.0,450.0] # STO
#ENERGIES = [1067, 1076 ] # Sm
#ENERGIES = [1170, 1181 ] # Gd
@@ -55,6 +62,7 @@ ENERGIES = [700.0] #Fe
#ENERGIES = [850.9, 849 ] # Ni
#ENERGIES = [516, 503] # V
#ENERGIES = [1455,1420] # Se
#ENERGIES = [84.3, 80]# Au4F
#####################
#open_valve()
+2 -1
View File
@@ -1,4 +1,5 @@
ID_ENERGY = 640
ID_ENERGY = 1234
# energy at which the ID offset should be determined
+20 -5
View File
@@ -3,7 +3,7 @@
###################################################################################################
import ch.psi.fda.ProcessorFDA as ProcessorFDA
import ch.psi.fda.LayoutFDA as LayoutFDA
import ch.psi.pshell.data.LayoutFDA as LayoutFDA
import ntpath
import traceback
import ch.psi.pshell.epics.ChannelSettlingCondition as ChannelSettlingCondition
@@ -369,6 +369,20 @@ def close_valve(delay = 0.5): #TODO: Check default delay
valve_try_open.write(0)
def set_energy (value, delay=0.5):
print "Set energy"
timeout_ms = 90000 # 1.5 minutes
tolerance = 0.3
energy.write(float(value))
try:
energy_done.waitValue(1, timeout_ms) # timeout is now 60, was -1
except:
if abs(energy.read() - energy_readback.read()) > tolerance:
throw
time.sleep(float(delay))
print "Done setting energy"
def old_set_energy (value, delay=0.5):
"""
"""
print "Set energy"
@@ -614,14 +628,15 @@ def set_au_mesh(value):
def get_scan_filename():
return str(get_exec_pars().output) + str(get_exec_pars().scanPath) + ".txt"
def log_scan_filename():
msg = "Created data file: " + str(get_scan_filename())
def log_scan_filename(name=None):
if name is None:
name=get_scan_filename()
msg = "Created data file: " + str(name)
print msg
log(msg)
def write_logs():
set_exec_pars(open = True) #Compensade bug on log function, which should open persistence context
log("Exit slit: "+ str(exit_slit.read()))
log("Exit slit: "+ str(exit_slit.read()), True)
log("Cff: " + str(cff.read()))
log("Harm: " + str(harmonic.read()))
log("FE: " + str(aperture.read() ))