From 7d7dd3799040029a4076117b7406f845bbc17030 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Tue, 15 Jun 2021 21:17:40 +0100
Subject: [PATCH] Updated some plot functions to better display the masseas

---
 binarycpython/utils/plot_functions.py | 30 ++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/binarycpython/utils/plot_functions.py b/binarycpython/utils/plot_functions.py
index 16a100333..e22812007 100644
--- a/binarycpython/utils/plot_functions.py
+++ b/binarycpython/utils/plot_functions.py
@@ -39,7 +39,7 @@ from binarycpython.utils.custom_logging_functions import binary_c_log_code
 # These are kept to the minimum necessary for each plotting routine.
 
 CUSTOM_LOGGING_STRING_MASSES = """
-Printf("MASS_PLOTTING %30.12e %g %g %g %g\\n",
+Printf("MASS_PLOTTING %30.12e %g %g %g %g %g %g\\n",
     //
     stardata->model.time, // 1
     
@@ -48,8 +48,10 @@ Printf("MASS_PLOTTING %30.12e %g %g %g %g\\n",
     stardata->common.zero_age.mass[1], //
 
     stardata->star[0].mass,
-    stardata->star[1].mass
-    );
+    stardata->star[1].mass,
+    stardata->star[0].core_mass[ID_core(stardata->star[0].stellar_type)],
+    stardata->star[1].core_mass[ID_core(stardata->star[1].stellar_type)]
+);
 """
 
 CUSTOM_LOGGING_STRING_ORBIT = """
@@ -341,7 +343,7 @@ def plot_masses(df, show_stellar_types: bool = False, show_plot: bool = True):
     )
 
     # Mass 1
-    fig.axes[0].plot(df["time"], df["mass_1"], label="star 1")
+    fig.axes[0].plot(df["time"], df["mass_1"], label="star 1", color='red')
     fig.axes[0].axhline(
         df["pms_mass_1"].values.tolist()[0],
         color="red",
@@ -350,17 +352,33 @@ def plot_masses(df, show_stellar_types: bool = False, show_plot: bool = True):
         label="Initial mass 1",
         alpha=0.5,
     )
+    fig.axes[0].plot(
+        df["time"], df["core_mass_1"],
+        color="red",
+        linestyle="-.",
+        linewidth=2,
+        label="Core mass 1",
+        alpha=0.5,
+    )
 
     # mass 2
     fig.axes[0].plot(df["time"], df["mass_2"], color="orange", label="star 2")
     fig.axes[0].axhline(
         df["pms_mass_2"].values.tolist()[0],
-        color="red",
+        color="orange",
         linestyle="--",
         linewidth=2,
         label="Initial mass 2",
         alpha=0.5,
     )
+    fig.axes[0].plot(
+        df["time"], df["core_mass_2"],
+        color="orange",
+        linestyle="-.",
+        linewidth=2,
+        label="Core mass 2",
+        alpha=0.5,
+    )
 
     # Make up
     fig.axes[0].set_title("Stellar mass evolution")
@@ -484,6 +502,8 @@ def parse_function_masses(output: str):
         "pms_mass_2",
         "mass_1",
         "mass_2",
+        "core_mass_1",
+        "core_mass_2",
     ]
 
     # Go over the output.
-- 
GitLab