From 973b1b922e102382d2a8d83eef02631059b20b8e Mon Sep 17 00:00:00 2001 From: Abelardo Moralejo Date: Sun, 11 Feb 2024 12:17:40 +0100 Subject: [PATCH] Update data_quality.ipynb Avoid a couple of errors: Use a example run which has been loaded, instead of a fixed run Better starting parameters for a fit --- notebooks/data_quality.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/data_quality.ipynb b/notebooks/data_quality.ipynb index 3ebd9eef5f..bbce51ef11 100644 --- a/notebooks/data_quality.ipynb +++ b/notebooks/data_quality.ipynb @@ -1395,7 +1395,7 @@ "# NOTE: you may have to play with starting parameters if fit does not converge:\n", "params, _ = curve_fit(gaus, xx[cc>min_content_for_fit], cc[cc>min_content_for_fit], \n", " sigma=cc[cc>min_content_for_fit]**0.5, \n", - " p0=[100, 400, 2])\n", + " p0=[100, np.nanmedian(cis['intensity_at_reference_rate'][subrun_mask]), 2])\n", "\n", "plt.plot(xx, gaus(xx, params[0], params[1], params[2]), linewidth=1,\n", " label=f'mean: {params[1]:.4f}, std: {params[2]:.4f}\\n Relative std dev: {params[2]/params[1]:.4f}')\n", @@ -1529,7 +1529,7 @@ "# cosmics rate dR/dI @ 422 p.e.\n", "#\n", "# Run number:\n", - "rr = 11125\n", + "rr = runlist[0]\n", "# 11125 example of a good (=selected) run\n", "# 10882 example of many rate spikes\n", "# Comment in runbook: \n",