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

Use run value of Beckhoff outputs to determine gas type

parent a9c07d4b
No related branches found
No related tags found
1 merge request!138Get pes fix
...@@ -135,16 +135,16 @@ mnemonics = { ...@@ -135,16 +135,16 @@ mnemonics = {
'key': 'u213.value', 'key': 'u213.value',
'dim': None},), 'dim': None},),
"PES_N2": ({'source': 'SA3_XTD10_PES/DCTRL/V30300S_NITROGEN', "PES_N2": ({'source': 'SA3_XTD10_PES/DCTRL/V30300S_NITROGEN',
'key': 'interlock.AActionState.value', 'key': 'hardwareState.value',
'dim': None},), 'dim': None},),
"PES_Ne": ({'source': 'SA3_XTD10_PES/DCTRL/V30310S_NEON', "PES_Ne": ({'source': 'SA3_XTD10_PES/DCTRL/V30310S_NEON',
'key': 'interlock.AActionState.value', 'key': 'hardwareState.value',
'dim': None},), 'dim': None},),
"PES_Kr": ({'source': 'SA3_XTD10_PES/DCTRL/V30320S_KRYPTON', "PES_Kr": ({'source': 'SA3_XTD10_PES/DCTRL/V30320S_KRYPTON',
'key': 'interlock.AActionState.value', 'key': 'hardwareState.value',
'dim': None},), 'dim': None},),
"PES_Xe": ({'source': 'SA3_XTD10_PES/DCTRL/V30330S_XENON', "PES_Xe": ({'source': 'SA3_XTD10_PES/DCTRL/V30330S_XENON',
'key': 'interlock.AActionState.value', 'key': 'hardwareState.value',
'dim': None},), 'dim': None},),
# XTD10 MCP (after GATT) # XTD10 MCP (after GATT)
......
...@@ -14,7 +14,7 @@ import extra_data as ed ...@@ -14,7 +14,7 @@ import extra_data as ed
from ..misc.bunch_pattern_external import is_sase_3 from ..misc.bunch_pattern_external import is_sase_3
from ..mnemonics_machinery import (mnemonics_to_process, from ..mnemonics_machinery import (mnemonics_to_process,
mnemonics_for_run) mnemonics_for_run)
from ..constants import mnemonics as _mnemonics
__all__ = [ __all__ = [
'get_pes_params', 'get_pes_params',
...@@ -169,10 +169,13 @@ def get_pes_params(run): ...@@ -169,10 +169,13 @@ def get_pes_params(run):
params = {} params = {}
sel = run.select_trains(ed.by_index[:20]) sel = run.select_trains(ed.by_index[:20])
mnemonics = mnemonics_for_run(run) mnemonics = mnemonics_for_run(run)
for gas in ['N2', 'Ne', 'Kr', 'Xe']: gas_dict = {'N2': 409.9, 'Ne': 870.2, 'Kr': 1921, 'Xe': 1148.7}
arr = sel.get_array(*mnemonics[f'PES_{gas}'].values()) for gas in gas_dict.keys():
if arr[0] == 0: mnemo = _mnemonics[f'PES_{gas}'][0]
arr = sel.get_run_value(mnemo['source'], mnemo['key'])
if arr == 'ON':
params['gas'] = gas params['gas'] = gas
params['binding_energy'] = gas_dict[gas]
break break
if 'gas' not in params: if 'gas' not in params:
params['gas'] = 'unknown' params['gas'] = 'unknown'
......
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