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

Adds warning if data rate < 95% in load()

parent cd8d4f37
No related branches found
No related tags found
1 merge request!263Adds warning if data rate < 95% in load()
Pipeline #110145 passed
......@@ -70,7 +70,7 @@ def load(proposalNB=None, runNB=None,
fields: str, list of str, list of dict
list of mnemonics to load specific data such as "fastccd",
"SCS_XGM", or dictionnaries defining a custom mnemonic such as
{"extra": {'source: 'SCS_CDIFFT_MAG/SUPPLY/CURRENT',
{"extra": {'source': 'SCS_CDIFFT_MAG/SUPPLY/CURRENT',
'key': 'actual_current.value',
'dim': None}}
subFolder: str
......@@ -209,7 +209,12 @@ def load(proposalNB=None, runNB=None,
'Skipping!')
continue
data_arrays.append(arr)
for arr in data_arrays:
rate = arr.sizes["trainId"] / len(run.train_ids)
if rate < 0.95:
log.warning(f'{arr.name}: only {rate*100:.1f}% of trains '
f'({arr.sizes["trainId"]} out of '
f'{len(run.train_ids)}) contain data.')
data = xr.merge(data_arrays, join='inner')
data.attrs['runFolder'] = runFolder
......
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