diff --git a/Load.py b/Load.py index 4b9cb1179110445b64aa1a4252ff98d3070e3025..4c81f83b13f7a66e53dfcb998d99b3f9ae948470 100644 --- a/Load.py +++ b/Load.py @@ -149,14 +149,15 @@ mnemonics = { "MCP4raw": {'source':'SCS_UTC1_ADQ/ADC/1:network', 'key':'digitizers.channel_1_D.raw.samples', 'dim': ['samplesId']}, - + # KARABACON "KARABACON": {'source':'SCS_DAQ_SCAN/MDL/KARABACON', 'key': 'actualStep.value', 'dim': None} } -def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, validate=False): +def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, + validate=False, runpath='/gpfs/exfel/exp/{}/{}/{}/raw/r{:04d}/'): """ Load a run and extract the data. Output is an xarray with aligned trainIds Inputs: @@ -169,12 +170,14 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, vali 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 + runpath: a string to fromat the run folder path with topic, + semesterNB, proposalNB and runNB Outputs: res: an xarray DataSet with aligned trainIds """ - runFolder = '/gpfs/exfel/exp/{}/{}/{}/raw/r{:04d}/'.format(topic, semesterNB, proposalNB, runNB) + runFolder = runpath.format(topic, semesterNB, proposalNB, runNB) run = RunDirectory(runFolder) if validate: