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

fix when gh2_dim is not in dataset

parent e5fec4a8
No related branches found
No related tags found
1 merge request!311fix when gh2_dim is not in dataset
Pipeline #157013 passed
...@@ -53,7 +53,7 @@ def extract_GH2(ds, run, firstFrame=0, bunchPattern='scs_ppl', ...@@ -53,7 +53,7 @@ def extract_GH2(ds, run, firstFrame=0, bunchPattern='scs_ppl',
pattern = XrayPulses(run) pattern = XrayPulses(run)
dim = 'sa3_pId' dim = 'sa3_pId'
others = [var for var in ds if dim in ds[var].coords] 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(): if pattern.is_constant_pattern():
pulse_ids = pattern.peek_pulse_ids(labelled=False) pulse_ids = pattern.peek_pulse_ids(labelled=False)
nds = nds.isel({gh2_dim: pulse_ids + firstFrame}) nds = nds.isel({gh2_dim: pulse_ids + firstFrame})
......
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