From 32cf859f02ac0681918424ebb0d7816bc40ee41f Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Tue, 13 Jun 2017 15:31:59 +0200 Subject: [PATCH] Script execution --- script/RFscan/SchottkyScanSet.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 script/RFscan/SchottkyScanSet.py diff --git a/script/RFscan/SchottkyScanSet.py b/script/RFscan/SchottkyScanSet.py new file mode 100644 index 0000000..3d5c49a --- /dev/null +++ b/script/RFscan/SchottkyScanSet.py @@ -0,0 +1,29 @@ +dry_run = True +do_elog = True + +if get_exec_pars().source == CommandSource.ui: + phaseOffset = args[0] + plt = None +else: + phaseOffset = args[0] + plt = args[1] + +phaseOffset = -phaseOffset + +if not dry_run: + caput('SINEG01-RSYS:SET-VSUM-PHASE-OFFSET-BASE', phaseOffset) + caput('SINEG01-RSYS:CMD-LOAD-CALIB-BEAM', 1) + + +if do_elog: + log_msg = "Phase offset: %0.1f" % bph_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() + "/SchottkyScanSetPlot.png") + plt.saveSnapshot(file_name , "png") + attachments = [file_name,] + elog("SchottkyScanSet", log_msg, attachments) + +show_message("Success setting phase reference") + \ No newline at end of file