diff --git a/notebooks/ePix100/Correction_ePix100_NBC.ipynb b/notebooks/ePix100/Correction_ePix100_NBC.ipynb index 7bc7b208d40caeaa113209437e42e73eb95d7105..7df412a554a1085f02602fd7f75e4f913b4e575d 100644 --- a/notebooks/ePix100/Correction_ePix100_NBC.ipynb +++ b/notebooks/ePix100/Correction_ePix100_NBC.ipynb @@ -635,11 +635,12 @@ " \"data.trainId\", data=seq_dc.train_ids, chunks=min(50, len(seq_dc.train_ids)))\n", " \n", " if np.isin('data.pulseId', list(seq_dc[instrument_src].keys())): # some runs are missing 'data.pulseId'\n", - " pulse_ids = seq_dc[instrument_src]['data.pulseId'].ndarray().squeeze().tolist()\n", - " if isinstance(pulse_ids, int): # one pulse in case of correcting one train\n", - " pulse_ids = [pulse_ids]\n", + " pulseid = seq_dc[instrument_src]['data.pulseId'].ndarray().squeeze()\n", + " # pulseid is scalar for one train.\n", + " pulseid = [pulseid] if not pulseid.shape else list(pulseid)\n", + "\n", " outp_source.create_key(\n", - " \"data.pulseId\", data=pulse_ids, chunks=min(50, len(seq_dc.train_ids)))\n", + " \"data.pulseId\", data=pulseid, chunks=min(50, len(seq_dc.train_ids)))\n", " \n", " if pattern_classification:\n", " # Add main corrected `data.image.pixels` dataset and store corrected data.\n",