From be4c3f1a8f8e1af9926dc6ec3609fc167ee0e1fd Mon Sep 17 00:00:00 2001 From: Tristan Pinsonneault-Marotte Date: Mon, 16 Sep 2024 14:28:56 -0700 Subject: [PATCH] fix(uxm_setup.setup_fixed_tones): Check a tune is present. --- sodetlib/operations/uxm_setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sodetlib/operations/uxm_setup.py b/sodetlib/operations/uxm_setup.py index 0e34bd1..d998a01 100644 --- a/sodetlib/operations/uxm_setup.py +++ b/sodetlib/operations/uxm_setup.py @@ -424,8 +424,13 @@ def setup_fixed_tones( bands = cfg.dev.exp['active_bands'] + # ensure we have a tune available + try: + _ = S.freq_resp[bands[0]]["resonances"] + except KeyError as e: + raise ValueError("No tune is available to set fixed tones from.") from e + # identify available frequencies - # TODO check we have a tune? ft_freq = [] for b in bands: ft_freq += list(_find_fixed_tone_freq(S, b, fixed_tones_per_band, min_gap))