Storage¶
Storage is a Pyrame module that manages data created by other modules and its inclusion on the RunDB <cmd_rundb>.
Storage allows to use a mount point and a path to transparently store data elsewhere in the network. It also automates common tasks such as saving the calxml configuration and a log with optional varmod variables (e.g.: stats) at the same place as data files.
API¶
-
cmd_storage.
init_storage
(storage_id, use_rundb, brg_name, brg_mp, brg_path, brg_parent_id, elog_server, elog_name, stats_names, producers_count)[source]¶ Initialize storage named storage_id.
use_rundb (1/0) indicates if the RunDB should be populated. brg arguments refer to the base run group: brg_mp mount point, brg_path path relative the the mount point, brg_parent_id RunDB id of the brg parent.
elog_server and elog_name describe the elog to be used, if any.
stats_names is a comma-separated list of varmod variables to be stored on the log of the acquisitions.
producers_count is an integer with the number of producers that will call the function mark_as_finished_storage. Once all of them will have called the function, storage will mark the aquisition as finished.
-
cmd_storage.
new_run_storage
(storage_id, run_name, mode='append')[source]¶ Create run with run_name on storage_id. mode can be append (do not remove anything) or remove (if something exists with the same name it is removed before starting).
-
cmd_storage.
set_param_run_storage
(storage_id, run_name, param, value)[source]¶ Set a parameter param with value for run_name on storage_id. If use_rundb (init_storage) is 0, this function does nothing.
-
cmd_storage.
new_acq_storage
(storage_id, acq_name, run_name, mode='append', convert_script='undef')[source]¶ Create acquisition with acq_name in run_name. mode can be append (do not remove anything: reuse or append) or remove (if something exists with the same name it is removed before starting). At the end of the acquistion launch convert_script
-
cmd_storage.
set_param_acq_storage
(storage_id, acq_id, param, value)[source]¶ Set a parameter param with value for acq_id on storage_id. If use_rundb (init_storage) is 0, this function does nothing.