aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2016-03-11 11:54:40 +0100
committerVolker Hoffmann <volker@cheleb.net>2016-03-11 11:54:40 +0100
commit833ee7ea421a6b512700fef5515ad09c74fd2d75 (patch)
tree6dca6be23afbb55579f7947f8c9735ebadc2ad3e
parent33e5dafc7f0fdff12ad683a3a9d3b79cff4bb3c9 (diff)
feat: option to override weights in KDE
-rw-r--r--Helpers/formation_helpers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Helpers/formation_helpers.py b/Helpers/formation_helpers.py
index 86109ff..02db764 100644
--- a/Helpers/formation_helpers.py
+++ b/Helpers/formation_helpers.py
@@ -79,7 +79,7 @@ def assign_wmf_ronco2014(a):
def compute_kde(df, evaluation_range, evaluation_range_step, variable, \
- cov_tight_factor=4.0, integrates_to=-1):
+ cov_tight_factor=4.0, integrates_to=-1, noweights=False):
"""
Compute Kernel Density Estimate for Formation Runs.
@@ -126,6 +126,10 @@ def compute_kde(df, evaluation_range, evaluation_range_step, variable, \
weights = np.asarray(df.mass/df.mass.max())
else:
weights = np.ones_like(df.mass)
+
+ # Override Weights?
+ if noweights:
+ weights = np.ones_like(df.mass)
# Compute KDE
cv = sh.Covariator(np.atleast_2d(input_array), weights)