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 # Import the WinNet python plot-routine
5 # Note that you can also just append the path to your .bashrc
6 import sys
7 sys.path.append('../../bin')
8 from class_files.winnet_class import winnet
9 
10 
11 # Read the mainout
12 nsm_example = winnet(".")
13 nsm_example.read_mainout()
14 # Plot the mainout
15 fig = nsm_example.plot_mainout()
16 
17 # Also plot the final abundances
18 fig2 = plt.figure()
19 ax = fig2.gca()
20 # Read the finab
21 nsm_example.read_finab()
22 A,X = nsm_example.get_final_A_X()
23 # Plot the massfraction, summed over equal mass numbers
24 ax.plot(A,X)
25 ax.set_ylabel("Mass fraction")
26 ax.set_xlabel("Mass number")
27 ax.set_yscale("log")
28 ax.set_xlim(0,140)
29 ax.set_ylim(1e-8,1)
30 
31 # Read the template file
32 nsm_example.read_template()
33 # To get an overview we can plot the considered nuclei in the calculation
34 fig3 = nsm_example.plot_sunet()
35 
36 
37 # Save the figures
38 fig.savefig("mainout_nsm_wind_martin.pdf",bbox_inches="tight")
39 fig2.savefig("Final_mass_fractions_nsm_wind_martin.pdf",bbox_inches="tight")
40 fig3.savefig("Included_nuclei_nsm_wind_martin.pdf",bbox_inches="tight")
41 
42 plt.show()