From 12119c8987add09aadb23497258bc2b8bd8798cc Mon Sep 17 00:00:00 2001 From: Gaia Verna Date: Wed, 30 Sep 2020 19:14:15 +0200 Subject: [PATCH] Fix integration of power law pdf in simulations.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by Maximilian Nöthe --- pyirf/simulations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyirf/simulations.py b/pyirf/simulations.py index 46e80ec18..9141a4a03 100644 --- a/pyirf/simulations.py +++ b/pyirf/simulations.py @@ -182,8 +182,8 @@ def _powerlaw_pdf_integral(index, e_low, e_high, e_min, e_max): e_max = e_max.to_value(u.TeV) int_index = index + 1 - e_term = e_low ** int_index - e_high ** int_index - normalization = int_index / (e_max ** int_index - e_min ** int_index) + normalization = 1 / (e_max ** int_index - e_min ** int_index) + e_term = e_high ** int_index - e_low ** int_index return e_term * normalization