diff --git a/notebooks/ePix100/Correction_ePix100_NBC.ipynb b/notebooks/ePix100/Correction_ePix100_NBC.ipynb index baa4bc08c982e90ef187d5ae802cc34a6af0762c..ea7507c844aa59198a8b8ed0781c0641cc152884 100644 --- a/notebooks/ePix100/Correction_ePix100_NBC.ipynb +++ b/notebooks/ePix100/Correction_ePix100_NBC.ipynb @@ -793,20 +793,9 @@ "outputs": [], "source": [ "if absolute_gain :\n", - " d=[]\n", + " d = []\n", " ho, eo, co, so = histCalAbsGainCor.get()\n", - " d.append({\n", - " 'x': co,\n", - " 'y': ho,\n", - " 'y_err': np.sqrt(ho[:]),\n", - " 'drawstyle': 'steps-mid',\n", - " 'errorstyle': 'bars',\n", - " 'errorcoarsing': 2,\n", - " 'label': 'Absolute gain corr.'\n", - " })\n", - "\n", - " if pattern_classification:\n", - " ho, eo, co, so = histCalGainCorClusters.get()\n", + " if co is not None: # avoid adding None array, if calculator is empty.\n", " d.append({\n", " 'x': co,\n", " 'y': ho,\n", @@ -814,19 +803,33 @@ " 'drawstyle': 'steps-mid',\n", " 'errorstyle': 'bars',\n", " 'errorcoarsing': 2,\n", - " 'label': 'Charge sharing corr.'\n", + " 'label': 'Absolute gain corr.'\n", " })\n", + "\n", + " if pattern_classification:\n", + " ho, eo, co, so = histCalGainCorClusters.get()\n", + " if co is not None: # avoid adding None array, if calculator is empty.\n", + " d.append({\n", + " 'x': co,\n", + " 'y': ho,\n", + " 'y_err': np.sqrt(ho[:]),\n", + " 'drawstyle': 'steps-mid',\n", + " 'errorstyle': 'bars',\n", + " 'errorcoarsing': 2,\n", + " 'label': 'Charge sharing corr.'\n", + " })\n", " \n", " ho, eo, co, so = histCalGainCorSingles.get()\n", - " d.append({\n", - " 'x': co,\n", - " 'y': ho,\n", - " 'y_err': np.sqrt(ho[:]),\n", - " 'drawstyle': 'steps-mid',\n", - " 'errorstyle': 'bars',\n", - " 'errorcoarsing': 2,\n", - " 'label': 'Isolated photons (singles)'\n", - " })\n", + " if co is not None: # avoid adding None array, if calculator is empty.\n", + " d.append({\n", + " 'x': co,\n", + " 'y': ho,\n", + " 'y_err': np.sqrt(ho[:]),\n", + " 'drawstyle': 'steps-mid',\n", + " 'errorstyle': 'bars',\n", + " 'errorcoarsing': 2,\n", + " 'label': 'Isolated photons (singles)'\n", + " })\n", " \n", " fig = xana.simplePlot(\n", " d, aspect=1, x_label=f'Energy ({plot_unit})',\n",