Plot_me.py
Go to the documentation of this file.
1 # Author: M. Reichert
2 import numpy as np
3 import matplotlib.pyplot as plt
4 from matplotlib import cm
5 # Import the WinNet python plot-routine
6 # Note that you can also just append the path to your .bashrc
7 import sys
8 sys.path.append('../../bin')
9 from class_files.winnet_class import winnet
10 
11 # Create a first Figure.
12 fig = plt.figure()
13 ax = fig.gca()
14 # Read the finab of a normal representative case
15 nsm_example = winnet('tracer_492.dat')
16 nsm_example.read_finab()
17 A,X = nsm_example.get_final_A_X()
18 # Plot the massfraction, summed over equal mass numbers
19 ax.plot(A,X,lw=2,color="tab:blue",label="Representative with high mass")
20 
21 # Read the finab of a high entropy case (see Bovard et al. 2017)
22 nsm_example_2 = winnet('tracer_1131.dat')
23 nsm_example_2.read_finab()
24 A,X = nsm_example_2.get_final_A_X()
25 # Plot the massfraction, summed over equal mass numbers
26 ax.plot(A,X,lw=2,color="tab:orange",label="High entropy with low mass")
27 
28 
29 
30 
31 ax.set_ylabel("Mass fraction")
32 ax.set_xlabel("Mass number")
33 ax.set_yscale("log")
34 ax.set_xlim(100,219)
35 ax.set_ylim(1e-6,1)
36 ax.legend(loc="upper left")
37 plt.savefig("massfractions_nsm_dyn_ejecta_bovard.pdf",bbox_inches="tight")
38 plt.show()