Script execution

This commit is contained in:
gac-x04sa
2019-08-21 15:12:24 +02:00
parent 3f95685860
commit 7ea80ab80c

View File

@@ -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)