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 fig = plt.figure()
12 ax = fig.gca()
13 
14 # Load data from the mainout
15 mrsn_example = winnet('.')
16 
17 # Read and plot the tracked nuclei
18 mrsn_example.read_tracked_nuclei()
19 time = mrsn_example.get_tracked_time()
20 nucs = ["eu151","eu153","th232","u236"]
21 label = [r"$^{151}$Eu","$^{153}$Eu","$^{232}$Th","$^{236}$U"]
22 for ind,n in enumerate(nucs):
23  X = mrsn_example.get_tracked_nuclei(n,massfraction=True)
24  ax.plot(time,X,label=label[ind],lw=2)
25 ax.legend(loc="upper left")
26 ax.set_yscale("log")
27 ax.set_xscale("log")
28 ax.set_ylim(1e-7,1e-2)
29 ax.set_xlim(1e-1,1e17)
30 ax.set_ylabel("Mass fraction")
31 ax.set_xlabel("Time [s]")
32 
33 
34 # Also plot the final abundances
35 fig2 = plt.figure()
36 ax2 = fig2.gca()
37 # Read the finab
38 mrsn_example.read_finab()
39 A,X = mrsn_example.get_final_A_X()
40 # Plot the massfraction, summed over equal mass numbers
41 ax2.plot(A,X)
42 ax2.set_ylabel("Mass fraction")
43 ax2.set_xlabel("Mass number")
44 ax2.set_yscale("log")
45 ax2.set_xlim(0,249)
46 ax2.set_ylim(1e-8,1)
47 
48 # fig2.savefig("Final_mass_fractions.pdf",bbox_inches="tight")
49 
50 plt.show()