Skip to content
Snippets Groups Projects
Commit 5b1ae75b authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

Gives the option to define a different data path formating string

parent e8086845
No related branches found
No related tags found
No related merge requests found
...@@ -149,14 +149,15 @@ mnemonics = { ...@@ -149,14 +149,15 @@ mnemonics = {
"MCP4raw": {'source':'SCS_UTC1_ADQ/ADC/1:network', "MCP4raw": {'source':'SCS_UTC1_ADQ/ADC/1:network',
'key':'digitizers.channel_1_D.raw.samples', 'key':'digitizers.channel_1_D.raw.samples',
'dim': ['samplesId']}, 'dim': ['samplesId']},
# KARABACON # KARABACON
"KARABACON": {'source':'SCS_DAQ_SCAN/MDL/KARABACON', "KARABACON": {'source':'SCS_DAQ_SCAN/MDL/KARABACON',
'key': 'actualStep.value', 'key': 'actualStep.value',
'dim': None} '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 """ Load a run and extract the data. Output is an xarray with aligned trainIds
Inputs: Inputs:
...@@ -169,12 +170,14 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, vali ...@@ -169,12 +170,14 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, vali
topic: string of the topic topic: string of the topic
display: boolean, whether to show the run.info or not display: boolean, whether to show the run.info or not
validate: boolean, whether to run karabo-data-validate 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: Outputs:
res: an xarray DataSet with aligned trainIds 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) run = RunDirectory(runFolder)
if validate: if validate:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment