aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2015-12-18 15:43:54 +0100
committerVolker Hoffmann <volker@cheleb.net>2015-12-18 15:43:54 +0100
commit427be25a1361294a1bc4a1314c165a1844600c63 (patch)
treecb7606ae6c22b680b093a0bf9d74a08d672e128e
parent2223d25d29e125f684a9ad2c2ceeb85a53c75299 (diff)
fix: normalisation (wrong scale) in KDE integration
-rw-r--r--Helpers/formation_helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Helpers/formation_helpers.py b/Helpers/formation_helpers.py
index df1a629..98d60c0 100644
--- a/Helpers/formation_helpers.py
+++ b/Helpers/formation_helpers.py
@@ -134,7 +134,8 @@ def compute_kde(df, evaluation_range, evaluation_range_step, variable, \
# Normalize to Total Number of Particles (Int{dN/dM} = N)
else:
- dmx = np.diff(10.0**evaluation_range) # Midpoints in mrange, convert to lin
+ # dmx = np.diff(10.0**evaluation_range) # Midpoints in mrange, convert to lin
+ dmx = np.diff(evaluation_range)
kde_evaluated_x = \
(kde_evaluated[1:] + kde_evaluated[:-1]) / 2.0 # Linear Interp.
N_0 = np.sum(kde_evaluated_x * dmx)