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
1 merge request!14Fast ccd calibration
......@@ -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:
......
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