From 1aedfd68d46394e2b04d3c887c5cdf609180edf9 Mon Sep 17 00:00:00 2001 From: Laurent Mercadier <laurent.mercadier@xfel.eu> Date: Mon, 18 Nov 2024 22:01:13 +0100 Subject: [PATCH] fix when gh2_dim is not in dataset --- src/toolbox_scs/detectors/gotthard2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toolbox_scs/detectors/gotthard2.py b/src/toolbox_scs/detectors/gotthard2.py index bf2988c..4ff9366 100644 --- a/src/toolbox_scs/detectors/gotthard2.py +++ b/src/toolbox_scs/detectors/gotthard2.py @@ -53,7 +53,7 @@ def extract_GH2(ds, run, firstFrame=0, bunchPattern='scs_ppl', pattern = XrayPulses(run) dim = 'sa3_pId' others = [var for var in ds if dim in ds[var].coords] - nds = ds.drop_dims(dim) + nds = ds.drop_dims(dim, errors='ignore') if pattern.is_constant_pattern(): pulse_ids = pattern.peek_pulse_ids(labelled=False) nds = nds.isel({gh2_dim: pulse_ids + firstFrame}) -- GitLab