This commit is contained in:
sfop
2017-08-23 14:04:39 +02:00
parent 1207513d79
commit 64de6de219
19 changed files with 5300 additions and 60 deletions
+3 -2
View File
@@ -32,9 +32,10 @@ B = p0
#Plot setup
plt.clear()
plt.removeMarker(None)
plt.setStyle(plt.Style.ErrorY)
plt.addSeries(LinePlotErrorSeries("Momentum"))
plt.addSeries(LinePlotErrorSeries("Momentum Spread", None, 2))
plt.addSeries(LinePlotErrorSeries("Momentum", Color.red))
plt.addSeries(LinePlotErrorSeries("Momentum Spread", Color.yellow, 2))
plt.getAxis(plt.AxisId.X).setLabel("Gun Beam Phase (deg)")
plt.getAxis(plt.AxisId.Y).setLabel("Momentum (MeV/c)")
plt.getAxis(plt.AxisId.Y2).setLabel("Momentum Spread (MeV/c)")
+1 -1
View File
@@ -73,10 +73,10 @@ try:
chargerms = [val.stdev for val in r.getReadable(1)]
finally:
rph.write(rph0)
#bph.write(bph0)
bph.close()
rph.close()
q.close()
#st.close()
#Elog entry
if do_elog:
+4 -4
View File
@@ -1,12 +1,12 @@
import ch.psi.pshell.epics.Positioner as Positioner
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
dry_run = True
do_elog = False
dry_run = False
do_elog = True
if get_exec_pars().source == CommandSource.ui:
station = "STEST01"
bpm_ch = "SINBC02-DBPM140"
station = "SINSB01"
bpm_ch = "S10BD01-DBPM020"
else:
station = args[0]
bpm_ch = args[1]
+15 -20
View File
@@ -1,8 +1,8 @@
import ch.psi.pshell.epics.Positioner as Positioner
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
dry_run = True
do_elog = False
dry_run = False
do_elog = True
if get_exec_pars().source == CommandSource.ui:
start = -50.0
@@ -34,14 +34,14 @@ if dry_run:
else:
bph = Positioner("Beam phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
rph = ChannelDouble("RF phase", "SINEG01-RSYS:SET-VSUM-PHASE")
#st = Stream("ICTstream", dispatcher)
#q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
#st.initialize()
#st.start()
#st.waitValueChange(10000)
q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE")
q.initialize()
q.monitored=True
st = Stream("ICTstream", dispatcher)
q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
st.initialize()
st.start()
st.waitValueChange(10000)
#q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE")
#q.initialize()
#q.monitored=True
bph.config.minValue = -360.0
bph.config.maxValue = 360.0
@@ -62,21 +62,16 @@ def after_sample(record, scan):
plt.getSeries(0).appendData(record.positions[0], record.values[1].mean, record.values[1].stdev)
try:
rph_averager = create_averager(rph, nb, 0.1) # Set polling time to -1 for BS data to get all messages
q_averager = create_averager(q, nb, 0.1)
q_averager.monitored=True
r = lscan(bph, (rph_averager, q_averager), start, stop, step, latency=lat, after_read = after_sample)
q_averager = create_averager(q, nb, 0.1) # Set polling time to -1 for BS data to get all messages
r = lscan(bph, q_averager, start, stop, step, latency=lat, after_read = after_sample)
beamphase = r.getPositions(0)
rfphase = [val.mean for val in r.getReadable(0)]
rfphaserms = [val.stdev for val in r.getReadable(0)]
charge = [val.mean for val in r.getReadable(1)]
chargerms = [val.stdev for val in r.getReadable(1)]
charge = [val.mean for val in r.getReadable(0)]
chargerms = [val.stdev for val in r.getReadable(0)]
finally:
rph.write(rph0)
#bph.write(bph0)
bph.close()
rph.close()
q.close()
st.close()
#Elog entry
if do_elog: