diff --git a/prog/python/qqgg/.ob-jupyter/328a8fdd25bbfda79fa5fbbb448cff6e9e522401.png b/prog/python/qqgg/.ob-jupyter/328a8fdd25bbfda79fa5fbbb448cff6e9e522401.png new file mode 100644 index 0000000..3819fe4 Binary files /dev/null and b/prog/python/qqgg/.ob-jupyter/328a8fdd25bbfda79fa5fbbb448cff6e9e522401.png differ diff --git a/prog/python/qqgg/.ob-jupyter/60624f423d26291605a6802e987362d0b69be208.png b/prog/python/qqgg/.ob-jupyter/60624f423d26291605a6802e987362d0b69be208.png new file mode 100644 index 0000000..a18781d Binary files /dev/null and b/prog/python/qqgg/.ob-jupyter/60624f423d26291605a6802e987362d0b69be208.png differ diff --git a/prog/python/qqgg/.ob-jupyter/755de6f8b498e65521e27043c1ca1d5e1df443b7.png b/prog/python/qqgg/.ob-jupyter/755de6f8b498e65521e27043c1ca1d5e1df443b7.png deleted file mode 100644 index 99e4d55..0000000 Binary files a/prog/python/qqgg/.ob-jupyter/755de6f8b498e65521e27043c1ca1d5e1df443b7.png and /dev/null differ diff --git a/prog/python/qqgg/.ob-jupyter/a923176d253cc3f7a2213ae081583076cbd1b587.png b/prog/python/qqgg/.ob-jupyter/a923176d253cc3f7a2213ae081583076cbd1b587.png deleted file mode 100644 index 5dc80c9..0000000 Binary files a/prog/python/qqgg/.ob-jupyter/a923176d253cc3f7a2213ae081583076cbd1b587.png and /dev/null differ diff --git a/prog/python/qqgg/analytical_xs.org b/prog/python/qqgg/analytical_xs.org index d029135..8fb9563 100644 --- a/prog/python/qqgg/analytical_xs.org +++ b/prog/python/qqgg/analytical_xs.org @@ -688,8 +688,15 @@ We define an auxilliary method for convenience. ax_ratio.set_ylabel("ratio") draw_histogram( ax_ratio, - [heights / reference, edges], - errorbars=errors / reference, + [ + np.divide( + heights, reference, out=np.ones_like(heights), where=reference != 0 + ), + edges, + ], + errorbars=np.divide( + errors, reference, out=np.zeros_like(heights), where=reference != 0 + ), hist_kwargs=( histogram["hist_kwargs"] if "hist_kwargs" in histogram else dict() ), diff --git a/prog/python/qqgg/parton_density_function_stuff.org b/prog/python/qqgg/parton_density_function_stuff.org index dc56211..780f9f2 100644 --- a/prog/python/qqgg/parton_density_function_stuff.org +++ b/prog/python/qqgg/parton_density_function_stuff.org @@ -13,7 +13,6 @@ #+end_src #+RESULTS: -: Welcome to JupyROOT 6.20/04 ** Utilities #+BEGIN_SRC jupyter-python :exports both @@ -25,6 +24,8 @@ #+END_SRC #+RESULTS: +: The autoreload extension is already loaded. To reload it, use: +: %reload_ext autoreload ** Global Config #+begin_src jupyter-python :exports both :results raw drawer @@ -365,7 +366,7 @@ Let's set up a cut for the η of the other photon. #+end_src #+RESULTS: -: -2.499964851191033 +: -2.499992898428325 #+begin_src jupyter-python :exports both :results raw drawer part_hist = np.histogram(part_samples, bins=50, range=[-2.5, 2.5]) @@ -375,8 +376,8 @@ draw_histogram(ax, part_hist) #+RESULTS: :RESULTS: -: -[[file:./.ob-jupyter/755de6f8b498e65521e27043c1ca1d5e1df443b7.png]] +: +[[file:./.ob-jupyter/60624f423d26291605a6802e987362d0b69be208.png]] :END: #+begin_src jupyter-python :exports both :results raw drawer @@ -392,16 +393,8 @@ draw_histogram(ax, part_hist) #+RESULTS: :RESULTS: -: /home/hiro/Documents/Projects/UNI/Bachelor/prog/python/qqgg/tangled/plot_utils.py:108: RuntimeWarning: invalid value encountered in true_divide -: [heights / reference, edges], -: /home/hiro/Documents/Projects/UNI/Bachelor/prog/python/qqgg/tangled/plot_utils.py:109: RuntimeWarning: invalid value encountered in true_divide -: errorbars=errors / reference, -: /home/hiro/Documents/Projects/UNI/Bachelor/prog/python/qqgg/tangled/plot_utils.py:108: RuntimeWarning: invalid value encountered in true_divide -: [heights / reference, edges], -: /home/hiro/Documents/Projects/UNI/Bachelor/prog/python/qqgg/tangled/plot_utils.py:109: RuntimeWarning: invalid value encountered in true_divide -: errorbars=errors / reference, -|
| ( ) | -[[file:./.ob-jupyter/a923176d253cc3f7a2213ae081583076cbd1b587.png]] +|
| ( ) | +[[file:./.ob-jupyter/328a8fdd25bbfda79fa5fbbb448cff6e9e522401.png]] :END: * Total XS diff --git a/prog/python/qqgg/tangled/plot_utils.py b/prog/python/qqgg/tangled/plot_utils.py index 353d0e8..1b0baf7 100644 --- a/prog/python/qqgg/tangled/plot_utils.py +++ b/prog/python/qqgg/tangled/plot_utils.py @@ -105,8 +105,15 @@ def draw_ratio_plot(histograms, normalize_to=1, **kwargs): ax_ratio.set_ylabel("ratio") draw_histogram( ax_ratio, - [heights / reference, edges], - errorbars=errors / reference, + [ + np.divide( + heights, reference, out=np.ones_like(heights), where=reference != 0 + ), + edges, + ], + errorbars=np.divide( + errors, reference, out=np.zeros_like(heights), where=reference != 0 + ), hist_kwargs=( histogram["hist_kwargs"] if "hist_kwargs" in histogram else dict() ),