This commit is contained in:
follath_r
2017-09-01 17:10:03 +02:00
parent 9ed8f072fd
commit 57c96eec0f
3 changed files with 54 additions and 0 deletions

15
devices/m2rx.properties Normal file
View File

@@ -0,0 +1,15 @@
#Fri Sep 01 17:10:03 CEST 2017
defaultSpeed=0.0
estbilizationDelay=0
hasEnable=false
homingType=None
maxSpeed=NaN
maxValue=0.0
minSpeed=NaN
minValue=0.0
offset=0.0
precision=6
resolution=1.0E-6
rotation=false
scale=1.0
unit=mrad

33
script/PbpsPosYScan.py Normal file
View File

@@ -0,0 +1,33 @@
from mathutils import fit_polynomial
from mathutils import PolynomialFunction
import math
from plotutils import plot_function
print "Starting"
#Creating averaging devices
av_pos_y = create_averager(pbps53_ypos, count = 10, interval = -1, name = "av_pos_y")
#av_hamp_x.monitored = True
#av_pos_y.monitored = True
#The actuals scan
r=lscan(pbps53_my, [av_pos_y], -0.5, 0.5, 20, latency = 0.0)
#Fitting
values = to_array(r.getReadable(0), 'd')
positions = r.getPositions(0)
pars_polynomial = (a0, a1) = fit_polynomial(values, positions, 1)
#Writing metadata to data file
path = get_exec_pars().scanPath
set_attribute(path, "a0", a0)
set_attribute(path, "a1", a1)
#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)

6
script/Rolf/Example.py Normal file
View File

@@ -0,0 +1,6 @@
#camtool.start("SAROP21-PPRM102")
sensors = [xbpm_x, camtool.stream.getChild("x_rms"), camtool.stream.getChild("y_rms")]
tscan(sensors, 10, 1.0)