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

Add Fast ADC 2 detector in mnemonics_to_process()

parent 494bb616
No related branches found
No related tags found
1 merge request!215Clean digitizers peak functions and add documentation
...@@ -98,7 +98,7 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None): ...@@ -98,7 +98,7 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None):
merge_with: xarray Dataset merge_with: xarray Dataset
Dataset that may contain non-processed arrays Dataset that may contain non-processed arrays
detector: str detector: str
One in {'ADQ412', 'FastADC', 'XGM', 'BAM', 'PES'} One in {'ADQ412', 'FastADC', 'FastADC2', 'XGM', 'BAM', 'PES'}
func: function func: function
function that takes one argument, an unprocessed mnemonic string, function that takes one argument, an unprocessed mnemonic string,
and converts it into a processed one, i.e. from 'MCP2apd' to and converts it into a processed one, i.e. from 'MCP2apd' to
...@@ -112,7 +112,9 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None): ...@@ -112,7 +112,9 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None):
if func is None: if func is None:
def func(x): def func(x):
return x return x
det_list = ['ADQ412', 'FastADC', 'FastADC2', 'XGM', 'BAM', 'PES']
if detector not in det_list:
raise ValueError(f"Detector not supported. Expecting one in {det_list}")
if detector == 'BAM': if detector == 'BAM':
det_mnemos = [m for m in _mnemonics if 'BAM' in m] det_mnemos = [m for m in _mnemonics if 'BAM' in m]
default_mnemo = 'BAM1932M' default_mnemo = 'BAM1932M'
...@@ -130,9 +132,14 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None): ...@@ -130,9 +132,14 @@ def mnemonics_to_process(mnemo_list, merge_with, detector, func=None):
default_mnemo = 'MCP2apd' default_mnemo = 'MCP2apd'
default_processed = 'MCP2peaks' default_processed = 'MCP2peaks'
if detector == 'FastADC': if detector == 'FastADC':
det_mnemos = [m for m in _mnemonics if 'FastADC' in m] det_mnemos = [m for m in _mnemonics if 'FastADC' in m\
and 'FastADC2_' not in m]
default_mnemo = 'FastADC5raw' default_mnemo = 'FastADC5raw'
default_processed = 'FastADC5peaks' default_processed = 'FastADC5peaks'
if detector == 'FastADC2':
det_mnemos = [m for m in _mnemonics if 'FastADC2_' in m]
default_mnemo = 'FastADC2_5raw'
default_processed = 'FastADC2_5peaks'
if detector == 'PES': if detector == 'PES':
det_mnemos = [m for m in _mnemonics if 'PES' in m and 'raw' in m] det_mnemos = [m for m in _mnemonics if 'PES' in m and 'raw' in m]
default_mnemo = 'PES_W_raw' default_mnemo = 'PES_W_raw'
......
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