From d05af1824f2023705bebc15171e5aafbd90d4fed Mon Sep 17 00:00:00 2001 From: "Sergey E. Koposov" Date: Mon, 18 Nov 2024 04:19:48 +0000 Subject: [PATCH] protect against missing stuff in config --- py/rvspecfit/desi/desi_fit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py/rvspecfit/desi/desi_fit.py b/py/rvspecfit/desi/desi_fit.py index 2d1e8e2..392738a 100644 --- a/py/rvspecfit/desi/desi_fit.py +++ b/py/rvspecfit/desi/desi_fit.py @@ -1103,11 +1103,11 @@ def proc_desi(fname, sig0s = {} for s in setups: if config is not None: - if 'lsf_sigma0_angstrom' not in config: + if ('lsf_sigma0_angstrom' not in config + or s not in config['lsf_sigma0_angstrom']): cur_val = 0.5 # default value - logging.warning( - 'sigma0 of the templates is not specified, ' - f'using {cur_val}') + logging.warning('sigma0 of the templates is not specified ' + f'for setup {s} using {cur_val}') else: cur_val = config['lsf_sigma0_angstrom'][s] sig0s[s] = cur_val