From d5cd4419cd64b4099667c6bc449dfd902424927e Mon Sep 17 00:00:00 2001
From: Izzard <ri0005@orca.eps.surrey.ac.uk>
Date: Tue, 7 Dec 2021 13:19:09 +0000
Subject: [PATCH] add M1 dist option

---
 binarycpython/utils/distribution_functions.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/binarycpython/utils/distribution_functions.py b/binarycpython/utils/distribution_functions.py
index 89abfde88..f998755ae 100644
--- a/binarycpython/utils/distribution_functions.py
+++ b/binarycpython/utils/distribution_functions.py
@@ -1805,7 +1805,12 @@ class distribution_functions():
 
         # TODO: Create an n-part-powerlaw method that can have breakpoints and slopes. I'm using a three-part power law now.
         # TODO: is this actually the correct way? putting the M1 in there? Do we sample in log space?
-        M1_probability = self.Kroupa2001(options["M_1"]) * options["M_1"]
+
+        if "M_1 dist" in options:
+            M1_probability = eval(options["M_1 dist"]) * options["M_1"]
+        else:
+            M1_probability = self.Kroupa2001(options["M_1"]) * options["M_1"]
+        
         prob_dict["M_1"] = M1_probability
         verbose_print(
             "\tMoe_di_Stefano_2017_pdf: Appended Mass (m={}) probability ({}) to the prob dict ({})".format(
-- 
GitLab