From 7ea80ab80cad459b01c938edb4b393ddd6485cba Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Wed, 21 Aug 2019 15:12:24 +0200 Subject: [PATCH] Script execution --- script/local.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/script/local.py b/script/local.py index 99d4ff6..65b8ea1 100644 --- a/script/local.py +++ b/script/local.py @@ -322,11 +322,31 @@ def save_metadata(rec, scan): create_diag_datasets() append_diag_datasets() +def save_experiment_context(parent = None): + if parent is None: + parent = get_exec_pars().group + group = parent + "experiment/" + if get_setting(USER_NAME_PREFERENCE): save_dataset(group+"user" , get_setting(USER_NAME_PREFERENCE)) + if get_setting(USER_EXP_PREFERENCE): save_dataset(group+"name" , get_setting(USER_EXP_PREFERENCE)) + if get_geometry(): save_dataset(group+"geometry" , get_geometry()) + ctxt = get_exp_context() + limits,constraints,ub_name = ctxt["limits"], ctxt["constraints"], ctxt["ub"] + if limits: + save_dataset(group+"limits" , str(limits)) + if (constraints): + save_dataset(group+"constraints" , str(constraints)) + if (ub_name): + save_dataset(group+"ub_name" , str(ub_name)) + ub_matrix = getub() + save_dataset(group+"ub" ,ub_matrix) + + + def before_sample(position, scan): - if scan.recordIndex == 0: - print "Starting" + if scan.recordIndex == 1: + save_experiment_context() auto_before_sample(position, scan) trigger_detectors(position, scan)