From 35f91adb5a50cc28981a43e0a83960f97643cdeb Mon Sep 17 00:00:00 2001 From: David Hendriks <davidhendriks93@gmail.com> Date: Sat, 9 Jan 2021 13:38:37 +0000 Subject: [PATCH] fixed some bugs in the distributions --- binarycpython/utils/distribution_functions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/binarycpython/utils/distribution_functions.py b/binarycpython/utils/distribution_functions.py index b9476e045..be040aa73 100644 --- a/binarycpython/utils/distribution_functions.py +++ b/binarycpython/utils/distribution_functions.py @@ -118,7 +118,7 @@ def const( print("out of bounds") prob = 0 return prob - prob = 1.0 / (min_bound - max_bound) + prob = 1.0 / (max_bound - min_bound) return prob @@ -501,12 +501,12 @@ def ktg93(m: Union[int, float], newopts: dict = None) -> Union[int, float]: return three_part_powerlaw( m, value_dict["m0"], - value_dict["m0"], + value_dict["m1"], value_dict["m2"], - value_dict["m0"], - value_dict["m0"], - value_dict["m0"], - value_dict["m0"], + value_dict["mmax"], + value_dict["p1"], + value_dict["p2"], + value_dict["p3"], ) @@ -577,7 +577,7 @@ def imf_chabrier2003(m: Union[int, float]) -> Union[int, float]: chabrier_a1 = 0.158 chabrier_a2 = 4.43e-2 chabrier_x = -1.3 - if m < 0: + if m <= 0: print("below bounds") raise ValueError if 0 < m < 1.0: -- GitLab