Script execution

This commit is contained in:
sfop
2017-02-14 15:38:47 +01:00
parent 09f59caaaf
commit dce8a028b0
+7 -7
View File
@@ -24,9 +24,8 @@ phase.config.resolution = 0.5
phase.initialize()
#camtool = Camtool("sflca:10000")
camtool.stop()
camtool.start("simulation")
x = camtool.getValue("gr_x_fit_mean")
dx = camtool.getValue("gr_x_fit_standard_deviation")
class FitMean(Readable):
def read(self):
@@ -38,20 +37,21 @@ class FitStdev(Readable):
#x = Channel("SINEG01-DSCR190:X-SIM", type = 'd', alias='SCR-X')
#dx = Channel("SINEG01-DSCR190:DX-SIM", type = 'd', alias='SCR-DX')
x = FitMean()
dx = FitStdev()
try:
xb = create_averager(FitMean(), nb, 0.100)
dxb = create_averager(FitStdev(), nb, 0.100)
xb = create_averager(x, nb, 0.100)
dxb = create_averager(dx, nb, 0.100)
r = lscan(phase, [xb, dxb], start, stop, step , latency=lat)
rf_phase = r.getPositions(0)
E = [val.mean/1000.0/disp*energy0 for val in r.getReadable(0)]
dE = [val.mean/1000.0/disp*energy0 for val in r.getReadable(1)]
finally:
phase.close()
# camtool.close()
camtool.close()
p = plot(None)[0]
p = plot(None, title="Output")[0]
p.clear()
p.addSeries(LinePlotSeries("Energy"))
p.addSeries(LinePlotSeries("Energy spread"))