This commit is contained in:
gobbo_a
2017-08-29 17:24:24 +02:00
parent acedfae72b
commit 778b48a092
9 changed files with 114 additions and 45 deletions

View File

@@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAvEQPJ+OW/ctH32MZKHln9+vXvMpST3UOJbk9nPTGM7bYYMjs
bEjg9hHNTHtr+VA4AtQzmzOXeAPqG5zy1lAcoPMrz3Kj9fou86cdMxbN6ei3rFVb
9dDSMLGrGAVuR+iTAch0FNVru5BvZm4s+fn3pyYuy1GcKLv7/pyYdoqiYdUm7ZDL
VhFJjtSmIswCArcv5rpvlTHLGmLirEq9KC6xkcoWnyPACAw/rbWKUuVobXcrcoic
G6N4gZt5Ekl7qg3AUFnKtw2/l6rfx4WFZjRdevGx7k14I4m6UCv/t040dMhCyUXJ
zP73WZTdV3TR4C643ZXkoXNlnlm8uOeSvOy85wIDAQABAoIBAFJddEP/Tg+637bb
pCYQ92t/wuLVoS0iCQ53/HyumggF9qRhQw4c1E7Tev37AUIR1m9mZy1/ZMUc8U8j
Wxpn8h54RLJ9dT4oNmJiumOflna/WZwLvC/PLCYhlLjtp1HOboJZMG/s7zUf+5zU
ltjGg5KdIdvR2H/5vkWmPQ2fmWszFVKbB+RPX9NbAcQMIXwATcIN3tbsISuydaf6
w0Laa07oGpcMYTJzP1TJAVluUHWfouPoHdDcVc0g737o1wIFQ35e6bbYzM5zBkHJ
dQo7CeET+5+HZjsC9MQRiWw853GYJp0w+bKjDov/aIBJt6ZVx+KB8sZccSofVbaY
JvpwAAECgYEA6nHID0Lgo/P0aFneo38c9MlEdGRLxrfXwsY8LhnKtkF0wgz1Is40
be6cVIz/XzXvHnB3WrAMsdz2MPiU4COz5T48z9hNcb/BMrVvNCN3x2Bu/FU4qMVU
vKJIhsL9Hq/TF3W0crA+DObvl9Kv4tIQ7hQK/xvbGpsoOiqV4A26Lu8CgYEAzZNa
Nl3W5Ut+VqaEdnED26pbZtzM8eLwioUNme9Etl+WrJQervNf8j8GJ8BUhOVjQrDT
hqA2bkXfBqxYaW2G8wnOVhq6jqLFfb3yZjpOsUf1T2x7naHW2Z3VEPlnMez2GJB/
/jkRegcXqPMtk8TahbaY/gTjOc+eFTefuDuQUYkCgYAKxlfve59faaLd+ONmmDz4
cxeWUdW5uFFOPlYduEm8vp1jHb1WcCuwsbq1mBVUhuIKgBi8LkMnGYSnE4WkF3/5
FTcuRj6o76stbXFC8C5dF22CY1hLSWZvlPXIW8XOVz5YYax9aOQxK5vvWluDDSyC
BKHMv7b+LgtXQQXKWlcoOQKBgAv7hsqcdaYv3FFYq2fr9nmbWHCKdjezLqokT0Kl
u6+Vqsasa41vCiyol8dBYqvMYxjEDdBPDl0nHXTaHt0mUTNhYvGJ5U3jFvfZVoO2
6ldTBm12uU3a3RcaKA0xPF6gnUeZRJyg3u/p8esbIZD3bHVWy1wjFMuN2n0KHPk0
H5lhAoGAO8YqRVnHOoz7HeA16+LZoOorDA9r/NEN3/K/jgOJPfrm3CV205Ew7mvQ
Y6im34HAcjHp2fz/kxE0S4vd2iWapMpiQu0U2yvLdX+861pkM/ffAg6x3nEJChzp
lh8rxqEJy4PukTBxUAL0h5wnOWkRYFgOVcx60rHvYJZ8+Qf3lbc=
-----END RSA PRIVATE KEY-----

View File

@@ -43,4 +43,9 @@ gsy=ch.psi.pshell.epics.Positioner|SINEG01-MSOL130:Y_SP SINEG01-MSOL130:Y|||true
gsrx=ch.psi.pshell.epics.Positioner|SINEG01-MSOL130:ROT_X_SP SINEG01-MSOL130:ROT_X|||true
gsry=ch.psi.pshell.epics.Positioner|SINEG01-MSOL130:ROT_Y_SP SINEG01-MSOL130:ROT_Y|||true
camtool=ch.psi.pshell.bs.Camtool|localhost:10005|||
cam_server=ch.psi.pshell.bs.PipelineServer|sf-daqsync-01:8889|||
#SINEG01-DBPM340:Q=ch.psi.pshell.device.Averager|SINEG01-DBPM340:Q|||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
adc_xh1=ch.psi.pshell.epics.ChannelInteger|SARFE10-PBPG050:HAMP-014-x-h1-DATA-SUM|||true
adc_yh2=ch.psi.pshell.epics.ChannelInteger|SARFE10-PBPG050:HAMP-011-y-h2-DATA-SUM|||true

View File

@@ -1,4 +1,4 @@
#Fri Aug 25 16:03:30 CEST 2017
#Tue Aug 29 09:48:39 CEST 2017
maxValue=360.0
minValue=-360.0
offset=0.0

View File

@@ -1,29 +1,29 @@
#Mon Aug 28 14:19:02 CEST 2017
#Tue Aug 29 17:23:58 CEST 2017
colormap=Flame
colormapAutomatic=false
colormapMax=4436.0
colormapMin=38.0
flipHorizontally=false
flipVertically=false
colormapAutomatic=true
colormapMax=600.0
colormapMin=83.0
flipHorizontally=true
flipVertically=true
grayscale=false
imageHeight=2160
imageWidth=2560
imageHeight=1024
imageWidth=1280
invert=false
regionStartX=1
regionStartY=1
rescaleFactor=1.0
rescaleOffset=0.0
roiHeight=-1
roiWidth=-1
roiX=0
roiY=0
roiHeight=186
roiWidth=146
roiX=593
roiY=338
rotation=0.0
rotationCrop=false
scale=1.0
serverURL=localhost\:10000
spatialCalOffsetX=-50.03909304143862
spatialCalOffsetY=-50.048875855327466
spatialCalScaleX=-1.0
spatialCalScaleY=-1.0
spatialCalOffsetX=-640.0
spatialCalOffsetY=-512.0
spatialCalScaleX=-8.4375
spatialCalScaleY=-8.49609375
spatialCalUnits=mm
transpose=false

View File

@@ -0,0 +1,24 @@
#Tue Aug 29 17:11:34 CEST 2017
colormap=Grayscale
colormapAutomatic=false
colormapMax=NaN
colormapMin=NaN
flipHorizontally=false
flipVertically=false
grayscale=false
invert=false
rescaleFactor=1.0
rescaleOffset=0.0
roiHeight=-1
roiWidth=-1
roiX=0
roiY=0
rotation=0.0
rotationCrop=false
scale=1.0
spatialCalOffsetX=NaN
spatialCalOffsetY=NaN
spatialCalScaleX=NaN
spatialCalScaleY=NaN
spatialCalUnits=mm
transpose=false

View File

@@ -0,0 +1,15 @@
#Tue Aug 29 15:25:30 CEST 2017
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
homingType=None
maxSpeed=10.0
maxValue=0.8
minSpeed=NaN
minValue=-0.6
offset=0.0
precision=3
resolution=0.02
rotation=false
scale=1.0
unit=mm

View File

@@ -0,0 +1,15 @@
#Tue Aug 29 15:25:39 CEST 2017
defaultSpeed=1.5
estbilizationDelay=0
hasEnable=false
homingType=None
maxSpeed=10.0
maxValue=1.0
minSpeed=NaN
minValue=-1.4
offset=0.0
precision=3
resolution=0.02
rotation=false
scale=1.0
unit=mm

View File

@@ -0,0 +1,34 @@
from mathutils import fit_polynomial
from mathutils import PolynomialFunction
import math
from plotutils import plot_function
print "Starting"
#Creating averaging devices
av_adc_xh1 = create_averager(adc_xh1, count = 10, interval = -1, name = "av_adc_xh1")
av_adc_xh2 = create_averager(adc_yh2, count = 10, interval = -1, name = "av_adc_xh2")
av_adc_xh2.monitored = True
#The actuals scan
r=lscan(pbpg_mx, [av_adc_xh1, av_adc_xh2], 0.0, 0.5, 10, latency = 0.0)
#Fitting
values = to_array(r.getReadable(0), 'd')
positions = r.getPositions(0)
pars_polynomial = (a0, a1, a2) = fit_polynomial(values, positions, 2)
#Writing metadata to data file
path = get_exec_pars().scanPath
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) + "a2="+ ("%0.4f" % a2)
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)

View File

@@ -423,4 +423,7 @@ def is_timing_ok():
def get_repetition_rate():
return caget("SIN-TIMAST-TMA:Evt-15-Freq-I")
#Device pool customization
pbpg_mx.setTrustedWrite(False)
pbpg_my.setTrustedWrite(False)