From 243d3fb0236a9223dee7c75f6d51244b492f08fb Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Wed, 21 Aug 2019 10:21:55 +0200 Subject: [PATCH] Script execution --- script/local.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/script/local.py b/script/local.py index 311b99c..cc1ba29 100644 --- a/script/local.py +++ b/script/local.py @@ -92,8 +92,9 @@ COUNT_TIME_PREFERENCE = "count_time" GEOMETRY_PREFERENCE = "geometry" ROI_PREFERENCE = "roi" BG_ROI_PREFERENCE = "bg_roi" -USER_PATH_PREFERENCE = "user_path" +USER_NAME_PREFERENCE = "user_name" USER_EXP_PREFERENCE = "user_exp" +DATA_ROOT_PREFERENCE = "data_root" def get_count_time(): """ @@ -176,17 +177,18 @@ def is_geometry_set(): return get_device("wavelength") is not None -def set_user_env(path, experiment, images_path=None): +def set_user_env(user, exp, data_root="/X04SA/data/x04sa/ES3/expdata"): """ - Sets user folder + Sets user folders """ - set_setting(USER_PATH_PREFERENCE, path) - set_setting(USER_EXP_PREFERENCE, experiment) - set_data_path(path + "/" +experiment) - pixel.set_path((path + "/image") if images_path is None else images_path, experiment) + set_setting(USER_NAME_PREFERENCE, user) + set_setting(USER_EXP_PREFERENCE, exp) + set_setting(DATA_ROOT_PREFERENCE, path) + set_data_path(path + "/" +user + "/" +experiment) + pixel.set_path(path, user + "/" +experiment+ "/images") def get_user_env(): - return (get_setting(USER_PATH_PREFERENCE), get_setting(USER_EXP_PREFERENCE)) + return (get_setting(USER_NAME_PREFERENCE), get_setting(USER_EXP_PREFERENCE), get_setting(DATA_ROOT_PREFERENCE)) def load_user_env():