From 7070c5dedf612c914be29d49f30b2bafb2ab8be8 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 9 May 2017 11:56:23 +0200 Subject: [PATCH] Startup --- script/Diagnostics/BlmGainScan.py | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/script/Diagnostics/BlmGainScan.py b/script/Diagnostics/BlmGainScan.py index f229d61..2234f1c 100644 --- a/script/Diagnostics/BlmGainScan.py +++ b/script/Diagnostics/BlmGainScan.py @@ -9,14 +9,15 @@ GAINS = ["SINDI02-DBLM084:M06-1-CH03-V-MM","SINDI02-DBLM084:M06-1-CH03-V-MM2",] BLMS = ["SINDI02-DBLM025", "SINDI02-DBLM085", "S10DI01-DBLM045"] ATTENUATORS = ["SINDI02-DBLM084:M06-1-ATT2-VAL", "SINDI02-DBLM084:M06-2-ATT2-VAL", "S10DI01-DBLM113:M06-1-ATT2-VAL"] RANGE = [0.5, 1.1] -STEP_SIZE = 0.01 +STEP_SIZE = 0.1 SETTLING_TIME = 0.5 +SIMULATION = True +do_elog = True gain_positioners = [] for i in range(len(GAINS)): - #gain_positioners.append(Channel(GAINS[i], alias = "gain " + str(i+1))) - gain_positioners.append( DummyPositioner("gain " + str(i+1))) + gain_positioners.append( DummyPositioner("gain " + str(i+1)) if SIMULATION else Channel(GAINS[i], alias = "gain " + str(i+1))) attenuators = [] for i in range(len(ATTENUATORS)): @@ -58,8 +59,14 @@ setup_plotting( line_plots = line_plots) #Metadata +set_attribute("/", "Samples" , SAMPLES) set_attribute("/", "BLM" , BLMS) set_attribute("/", "Gain" , GAINS) +set_attribute("/", "Range" , RANGE) +set_attribute("/", "Attenuators" , ATTENUATORS) +set_attribute("/", "StepSize" , STEP_SIZE) +set_attribute("/", "SamplingTime" , SETTLING_TIME) + for att in attenuators: set_attribute("/", att.setpoint.channelName, att.read()) @@ -68,3 +75,23 @@ try: finally: st.close() + +# save the entry in the logbook +if do_elog: + if get_option("Generated data file:\n" + get_exec_pars().path + "\n\n" + "Save to ELOG?", "YesNo") == "Yes": + gsa_log_msg = "Data file: " + get_exec_pars().path + gsa_log_msg = gsa_log_msg + "\nSamples = " + str(SAMPLES) + gsa_log_msg = gsa_log_msg + "\nBLM = " + str(BLMS) + gsa_log_msg = gsa_log_msg + "\nGain = " + str(GAINS) + gsa_log_msg = gsa_log_msg + "\nRange = " + str(RANGE) + gsa_log_msg = gsa_log_msg + "\nAttenuators = " + str(ATTENUATORS) + gsa_log_msg = gsa_log_msg + "\nStepSize = " + str(STEP_SIZE) + gsa_log_msg = gsa_log_msg + "\nSamplingTime = " + str(SETTLING_TIME) + + plots = get_plot_snapshots() + save=[] + for i in range(len(BLMS)): + save.append(plots[3*i]) + elog("Wire Scan", gsa_log_msg, save) + +