This commit is contained in:
gobbo_a
2019-03-06 14:14:42 +01:00
parent e91b596e1b
commit cf9bc7acfa
17 changed files with 124 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
#Wed Jan 24 10:56:20 CET 2018
#Tue Feb 12 14:33:52 CET 2019
autoSaveScanData=true
commandExecutionEvents=false
createSessionFiles=false
dataLayout=default
dataPath={data}/{year}/{month}/{day}/{date}_{time}_{name}
@@ -16,6 +17,7 @@ logLevel=Fine
logLevelConsole=Off
logPath={logs}/{date}_{time}
notificationLevel=null
saveCommandStatistics=false
scanStreamerPort=-1
serverEnabled=false
serverPort=8095

View File

@@ -1,17 +1,17 @@
pbpg_slow_x=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:SLOW-X|Read||true
pbpg_slow_y=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:SLOW-Y|Read||true
dispatcher=ch.psi.pshell.bs.Dispatcher|https://dispatcher-api.psi.ch/sf|||
cam_server=ch.psi.pshell.bs.PipelineServer|sf-daqsync-01:8889|||
pbps53_mx=ch.psi.pshell.epics.Motor|SARFE10-PBPS053:MOTOR_X1|||true
apu44x=ch.psi.pshell.epics.Motor|SARFE10-OAPU044:MOTOR_X|||true
pbps53_ypos=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPS053:YPOS|||true
pbps53_xpos=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPS053:XPOS|||true
pbps53_ypos=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPS053:YPOS|Read||true
pbps53_xpos=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPS053:XPOS|Read||true
pbps53_my=ch.psi.pshell.epics.Motor|SARFE10-PBPS053:MOTOR_Y1|||true
apu44y=ch.psi.pshell.epics.Motor|SARFE10-OAPU044:MOTOR_Y|||true
m1ba=ch.psi.pshell.epics.Motor|SAROP21-OOMV092:BA|||false
m1bb=ch.psi.pshell.epics.Motor|SAROP21-OOMV092:BB|||
xbpm_x=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:XBPM-XPOS|||true
xbpm_y=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:XBPM-YPOS|||true
hamp_x=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:HAMP-XPOS|||true
hamp_y=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:HAMP-YPOS|||true
hamp_x=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:HAMP-XPOS|Read||true
hamp_y=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:HAMP-YPOS|Read||true
pbpg_mx=ch.psi.pshell.epics.Motor|SARFE10-PBPG050:MOTOR_X|||true
pbpg_my=ch.psi.pshell.epics.Motor|SARFE10-PBPG050:MOTOR_Y|||true
m2rx=ch.psi.pshell.epics.Motor|SAROP21-OOMV096:W_RX|||true

View File

@@ -1,7 +1,8 @@
#Tue Aug 29 16:56:43 CEST 2017
#Tue Feb 12 14:33:52 CET 2019
configFile={config}/config.properties
configFileDevices={config}/devices.properties
configFilePlugins={config}/plugins.properties
configFileSettings={config}/settings.properties
configFileTasks={config}/tasks.properties
configPath={home}/config
contextPath={outp}/context

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.0
estbilizationDelay=1
hasEnable=false
@@ -12,5 +12,6 @@ precision=2
resolution=0.01
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.0
estbilizationDelay=1
hasEnable=false
@@ -12,5 +12,6 @@ precision=2
resolution=0.1
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,6 +1,7 @@
#Wed Sep 06 09:26:00 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
colormap=Flame
colormapAutomatic=true
colormapLogarithmic=false
colormapMax=NaN
colormapMin=NaN
flipHorizontally=false

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=0.05
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=1.0E-6
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=0.05
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=1.0E-6
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=100.0
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=6
resolution=0.001
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mrad

View File

@@ -1,4 +1,4 @@
#Mon Nov 06 13:38:48 CET 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=0.01
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Mon Nov 06 13:39:15 CET 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=0.01
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=1.953125E-5
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

View File

@@ -1,4 +1,4 @@
#Wed Oct 18 13:40:45 CEST 2017
#Tue Oct 30 09:54:17 CET 2018
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
@@ -12,5 +12,6 @@ precision=3
resolution=1.953125E-5
rotation=false
scale=1.0
sign_bit=0
startRetries=1
unit=mm

9
devices/posi.properties Normal file
View File

@@ -0,0 +1,9 @@
#Thu May 03 14:21:20 CEST 2018
maxValue=NaN
minValue=NaN
offset=0.0
precision=-1
resolution=NaN
rotation=false
scale=1.0
unit=null

View File

@@ -17,10 +17,17 @@ r=lscan(pbpg_mx, [av_hamp_x, av_xbpm_x], -1.5, 1.5, 100, latency = 0.0)
#Fitting
values = to_array(r.getReadable(0), 'd')
positions = r.getPositions(0)
pars_polynomial = (a0, a1) = fit_polynomial(values, positions, 1)
try:
pars_polynomial = fit_polynomial(values, positions, 1)
except:
print "Fit error"
raise
print "Plolynomial pars: ", pars_polynomial
(a0, a1) = pars_polynomial
#Writing metadata to data file
path = get_exec_pars().scanPath
print "Scn path: ", path
set_attribute(path, "a0", a0)
set_attribute(path, "a1", a1)
#set_attribute(path, "a2", a2)

38
script/PbpgSlowXScan.py Normal file
View File

@@ -0,0 +1,38 @@
from mathutils import fit_polynomial
from mathutils import PolynomialFunction
import math
from plotutils import plot_function
print "Starting"
#Creating averaging devices
avg_x = create_averager(pbpg_slow_x, count = 30, interval = 1, name = "avg_x")
#The actuals scan
r=lscan(pbpg_mx, avg_x, -1.5, 1.5, 30, latency = 0.0)
#Fitting
values = to_array(r.getReadable(0), 'd')
positions = r.getPositions(0)
try:
pars_polynomial = fit_polynomial(values, positions, 1)
except:
print "Fit error"
raise
print "Plolynomial pars: ", pars_polynomial
(a0, a1) = pars_polynomial
#Writing metadata to data file
path = get_exec_pars().scanPath
print "Scn path: ", path
set_attribute(path, "a0", a0)
set_attribute(path, "a1", a1)
#set_attribute(path, "a2", a2)
#Plotting fit and writing fitting parameters
outp = "a0="+ ("%0.4f" % a0) + "a1="+ ("%0.4f" % a1)
print outp
p = get_plots()[0]
p.addText((min(positions) + max(positions))/2, max(values), outp, Color.BLACK)
plot_function(p, PolynomialFunction(pars_polynomial), "Fit",positions, show_points = False, show_lines = True, color = Color.BLUE)

38
script/PbpgSlowYScan.py Normal file
View File

@@ -0,0 +1,38 @@
from mathutils import fit_polynomial
from mathutils import PolynomialFunction
import math
from plotutils import plot_function
print "Starting"
#Creating averaging devices
avg_y = create_averager(pbpg_slow_y, count = 30, interval = 1, name = "avg_y")
#The actuals scan
r=lscan(pbpg_my, avg_y, -1.5, 1.5, 30, latency = 0.0)
#Fitting
values = to_array(r.getReadable(0), 'd')
positions = r.getPositions(0)
try:
pars_polynomial = fit_polynomial(values, positions, 1)
except:
print "Fit error"
raise
print "Plolynomial pars: ", pars_polynomial
(a0, a1) = pars_polynomial
#Writing metadata to data file
path = get_exec_pars().scanPath
print "Scn path: ", path
set_attribute(path, "a0", a0)
set_attribute(path, "a1", a1)
#set_attribute(path, "a2", a2)
#Plotting fit and writing fitting parameters
outp = "a0="+ ("%0.4f" % a0) + "a1="+ ("%0.4f" % a1)
print outp
p = get_plots()[0]
p.addText((min(positions) + max(positions))/2, max(values), outp, Color.BLACK)
plot_function(p, PolynomialFunction(pars_polynomial), "Fit",positions, show_points = False, show_lines = True, color = Color.BLUE)