4 import matplotlib.pyplot
as plt
8 sys.path.append(
'../../bin')
9 from class_files.winnet_class
import winnet
18 ax.set_title(
"Hydrostatic CO burning")
23 Function to convert the element string that is given by WinNet
24 to a latex style string.
26 create_nucleus_name("ne20")
27 will output: r"$^{20}$Ne"
36 nuc_name =
r"$^{"+digits+
"}$"+chars[0].upper()+chars[1:]
41 w.read_tracked_nuclei()
42 names = w.get_tracked_nuclei_names()
43 time = w.get_tracked_time()
46 xpos_dic = {
"he4":4e-7,
"c12":3.8e-5,
"o16":1e-7,
"ne20":5e-3,
"mg24":4e2,
"si28":4e2,\
47 "s32":4e2,
"ar36":4e2,
"ca40":5e9,
"ti44":4e2,
"cr48":5e6,
"fe52":1e10,
"ni56":1e10}
51 X = w.get_tracked_nuclei(n)
52 line, = ax.plot(time,X)
56 idx = np.argmin(abs(time-xpos_dic[n]))
57 ax.text(xpos_dic[n],X[idx],out_name,ha=
"left",va=
"bottom",color=line.get_color())
60 ax_energy = ax.twinx()
61 time_energy,energy = np.loadtxt(
"generated_energy.dat",unpack=
True,usecols=[0,1])
62 ax_energy.plot(time_energy,energy,ls=
"--",lw=1,color=
"saddlebrown",zorder=-30,alpha=0.8)
63 ax_energy.text(5e-9,2e25,
r"$\epsilon$",color=
"k")
64 ax_energy.set_yscale(
"log")
65 ax_energy.set_ylabel(
r"Energy [erg g$^{-1}$ s$^{-1}$]")
66 ax_energy.set_ylim(1e11,1e27)
69 ax.set_xlabel(
"Time [s]")
70 ax.set_ylabel(
"Mass fraction")
72 ax.set_xlim(1e-11,1e12)
74 plt.savefig(
"CO_burning.pdf",bbox_inches=
"tight")