Skip to content
Snippets Groups Projects

Attributes

Merged Laurent Mercadier requested to merge attributes into master
2 files
+ 11
5
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 5
2
@@ -328,8 +328,8 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
or dictionnaries defining a custom mnemonic such as
{"extra": {'SCS_CDIFFT_MAG/SUPPLY/CURRENT', 'actual_current.value', None}}
runNB: run number as integer
proposalNB: string of the proposal number
semesterNB: string of the semester number where the proposal data are saved
proposalNB: string or int of the proposal number e.g. 'p002252' or 2252
semesterNB: string or int of the semester number where the proposal data are saved
topic: string of the topic
display: boolean, whether to show the run.info or not
validate: boolean, whether to run karabo-data-validate or not
@@ -346,6 +346,8 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
res: an xarray DataSet with aligned trainIds
"""
if type(proposalNB)==int:
proposalNB = 'p{:06d}'.format(proposalNB)
runFolder = runpath.format(topic, semesterNB, proposalNB, runNB)
run = RunDirectory(runFolder).select_trains(subset)
@@ -401,4 +403,5 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
result = dict(zip(keys, aligned_vals))
result = xr.Dataset(result)
result.attrs['run'] = run
result.attrs['runFolder'] = runFolder
return result
Loading