Closedown
This commit is contained in:
@@ -2,6 +2,7 @@ import ch.psi.pshell.epics.Positioner as Positioner
|
||||
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
|
||||
|
||||
dry_run = True
|
||||
do_elog = False
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
start = -30.0
|
||||
stop = 30.0
|
||||
@@ -54,7 +55,7 @@ rph0 = rph.read()
|
||||
#Record callback: uptate of output plot
|
||||
def after_sample(record, scan):
|
||||
if plt is not None:
|
||||
plt.getSeries(0).appendData(record.positions[0], record.values[0].mean, record.values[0].stdev)
|
||||
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
|
||||
@@ -80,6 +81,19 @@ rph_ref = rfphase[index_max] - 80
|
||||
print "Beam phase reference = ", bph_ref
|
||||
print "RF phase reference = ", rph_ref
|
||||
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n"
|
||||
log_msg = log_msg + "Beam phase reference: %0.1f" % bph_ref + "\n"
|
||||
log_msg = log_msg + "RF phase reference: %0.1f" % rph_ref + "\n"
|
||||
attachments = []
|
||||
if plt is not None:
|
||||
sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition
|
||||
file_name = os.path.abspath(get_context().setup.getContextPath() + "/SchottkyScanPlot.png")
|
||||
plt.saveSnapshot(file_name , "png")
|
||||
attachments = [file_name,]
|
||||
elog("Gun scan", log_msg, attachments)
|
||||
|
||||
set_return([bph_ref, rph_ref])
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,15 @@ dry_run = True
|
||||
do_elog = True
|
||||
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
phaseOffset = args[0]
|
||||
phaseOffset = rph_ref
|
||||
plt = None
|
||||
do_elog = False
|
||||
else:
|
||||
phaseOffset = args[0]
|
||||
plt = args[1]
|
||||
|
||||
print "Setting phase offset: ", phaseOffset
|
||||
|
||||
phaseOffset = -phaseOffset
|
||||
|
||||
if not dry_run:
|
||||
|
||||
Reference in New Issue
Block a user