diff --git a/notebooks/ePix100/Correction_ePix100_NBC.ipynb b/notebooks/ePix100/Correction_ePix100_NBC.ipynb index 35f8c78a453c3f33e8d20e76f76103247fedfd70..b904c578242b67c7e9918fdec8f66c7dd19d4ded 100644 --- a/notebooks/ePix100/Correction_ePix100_NBC.ipynb +++ b/notebooks/ePix100/Correction_ePix100_NBC.ipynb @@ -296,9 +296,13 @@ "metadata": {}, "outputs": [], "source": [ + "empty_constant = np.zeros((708, 768, 1), dtype=np.float32)\n", "if const_yaml: # Used while reproducing corrected data.\n", " print(f\"Using stored constants in {metadata.filename}\")\n", " const_data, _ = load_specified_constants(const_yaml[karabo_da][\"constants\"])\n", + " for cname, cval in const_data.items():\n", + " if cval is None and cname != \"RelativeGain\":\n", + " const_data[cname] = empty_constant\n", "else: # First correction attempt.\n", " const_data = dict()\n", " for cname, condition in const_cond.items():\n", @@ -311,7 +315,7 @@ " karabo_da=karabo_da,\n", " constant=getattr(Constants.ePix100, cname)(),\n", " condition=condition,\n", - " empty_constant=None,\n", + " empty_constant=None if cname == \"RelativeGain\" else empty_constant,\n", " cal_db_interface=cal_db_interface,\n", " creation_time=creation_time,\n", " print_once=2,\n",