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

More clean up of get_digitizer_peaks()

parent 66f5983c
No related branches found
No related tags found
1 merge request!215Clean digitizers peak functions and add documentation
......@@ -939,27 +939,27 @@ def get_digitizer_peaks(run, mnemonics=None, merge_with=None,
# find digitizer type and get the list of mnemonics to process
def to_processed_name(name):
return name.replace('raw', 'peaks').replace('apd', 'peaks')
if isinstance(mnemonics, str):
mnemonics = [mnemonics]
digitizer = digitizer_type(mnemonics[0], run_mnemonics)
else:
# find mnemonics to process in merge_with
for v in merge_with:
if 'FastADC2_' in v:
digitizer = 'FastADC2'
break
if 'FastADC' in v:
digitizer = 'FastADC'
break
if 'MCP' in v:
digitizer = 'ADQ412'
break
if mnemonics is None:
if digitizer is None:
for v in merge_with:
if 'FastADC2_' in v:
digitizer = 'FastADC2'
break
if 'FastADC' in v:
digitizer = 'FastADC'
break
if 'MCP' in v:
digitizer = 'ADQ412'
break
if digitizer is None:
log.warning(f'No array with digitizer data '
'to extract. Skipping.')
return merge_with
mnemonics = mnemonics_to_process(mnemonics, merge_with,
digitizer, to_processed_name)
else:
mnemonics = [mnemonics] if isinstance(mnemonics, str) else mnemonics
digitizer = digitizer_type(mnemonics[0], run_mnemonics)
if len(mnemonics) == 0:
log.info(f'No array with unaligned {digitizer} peaks to extract. '
......
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