Skip to content
Snippets Groups Projects
Commit 50a65338 authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

Modify load() to look at both raw and proc folders

parent 711e3a11
No related branches found
No related tags found
1 merge request!299GH2 and XOX mnemonics
Pipeline #145436 failed
...@@ -39,7 +39,6 @@ log = logging.getLogger(__name__) ...@@ -39,7 +39,6 @@ log = logging.getLogger(__name__)
def load(proposalNB=None, runNB=None, def load(proposalNB=None, runNB=None,
fields=None, fields=None,
subFolder='raw',
display=False, display=False,
validate=False, validate=False,
subset=None, subset=None,
...@@ -48,6 +47,7 @@ def load(proposalNB=None, runNB=None, ...@@ -48,6 +47,7 @@ def load(proposalNB=None, runNB=None,
extract_xgm=True, extract_xgm=True,
extract_bam=True, extract_bam=True,
bunchPattern='sase3', bunchPattern='sase3',
parallelize=True,
): ):
""" """
Load a run and extract the data. Output is an xarray with aligned Load a run and extract the data. Output is an xarray with aligned
...@@ -66,10 +66,6 @@ def load(proposalNB=None, runNB=None, ...@@ -66,10 +66,6 @@ def load(proposalNB=None, runNB=None,
{"extra": {'source': 'SCS_CDIFFT_MAG/SUPPLY/CURRENT', {"extra": {'source': 'SCS_CDIFFT_MAG/SUPPLY/CURRENT',
'key': 'actual_current.value', 'key': 'actual_current.value',
'dim': None}} 'dim': None}}
subFolder: str
'raw', 'proc' (processed) or 'all' (both 'raw' and 'proc') to access
data from either or both of those folders. If 'all' is used, sources
present in 'proc' overwrite those in 'raw'. The default is 'raw'.
display: bool display: bool
whether to show the run.info or not whether to show the run.info or not
validate: bool validate: bool
...@@ -97,10 +93,13 @@ def load(proposalNB=None, runNB=None, ...@@ -97,10 +93,13 @@ def load(proposalNB=None, runNB=None,
bunchPattern: str bunchPattern: str
bunch pattern used to extract the Fast ADC pulses. bunch pattern used to extract the Fast ADC pulses.
A string or a dict as in:: A string or a dict as in::
{'FFT_PD2': 'sase3', 'ILH_I0': 'scs_ppl'} {'FFT_PD2': 'sase3', 'ILH_I0': 'scs_ppl'}
Ignored if extract_digitizers=False. Ignored if extract_digitizers=False.
parallelize: bool
from EXtra-Data: enable or disable opening files in parallel.
Particularly useful if creating child processes is not allowed
(e.g. in a daemonized multiprocessing.Process).
Returns Returns
------- -------
...@@ -114,8 +113,8 @@ def load(proposalNB=None, runNB=None, ...@@ -114,8 +113,8 @@ def load(proposalNB=None, runNB=None,
>>> run, data = tb.load(2212, 208, ['SCS_SA3', 'MCP2apd', 'nrj']) >>> run, data = tb.load(2212, 208, ['SCS_SA3', 'MCP2apd', 'nrj'])
""" """
runFolder = find_run_path(proposalNB, runNB, subFolder) runFolder = find_run_path(proposalNB, runNB, 'raw')
run = ed.RunDirectory(runFolder) run = ed.open_run(proposalNB, runNB, data='all', parallelize=parallelize)
if subset is not None: if subset is not None:
run = run.select_trains(subset) run = run.select_trains(subset)
if fields is None: if fields is None:
......
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