From 8b7c168cd88ee39dc47e1b70c882381313f31824 Mon Sep 17 00:00:00 2001 From: jlashner Date: Wed, 12 Feb 2025 14:59:04 -0500 Subject: [PATCH] Catches failure mode where there are different numbers of channels between atten steps --- sodetlib/operations/optimize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sodetlib/operations/optimize.py b/sodetlib/operations/optimize.py index 95f4eb1f..bdf15376 100644 --- a/sodetlib/operations/optimize.py +++ b/sodetlib/operations/optimize.py @@ -127,7 +127,11 @@ def optimize_band_atten(S: SmurfControl, cfg, band, meas_time=30, wls_full[i] = res['noise_pars'][:, 0] fname = sdl.make_filename(S, f'atten_optimization_b{band}.npy') - wls_full = np.array(wls_full) + try: + wls_full = np.array(wls_full) + except: + print('Error: not all wls_full entries are of same shape. Could be due to different number of resonators on each step') + wls_full = None data = dict( band=band, total_att=total_att, ucs=ucs, sids=sids, wls=wls, wls_full=wls_full, path=fname, tunefiles=tunefiles, meta=sdl.get_metadata(S, cfg)