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)