3 import matplotlib.pyplot
as plt
5 sys.path.append(
'../../bin')
6 from class_files.nucleus_multiple_class
import nucleus_multiple
9 fig = plt.figure(figsize=(5,3))
14 path =
"final_abundances.txt"
18 with open(path,
"r")
as f:
27 if char ==
"=" and nuc.strip()!=
"":
29 nuc = nuc.strip().replace(
" ",
"")
31 if nuc.lower()==
"prot":
33 elif nuc.lower()==
"deut":
35 elif nuc.lower()==
"trit":
37 elif (nuc.lower()[:4]==
"al26"):
41 if (nuc!=
"al26")
or (
not (
"al26" in nuclei)):
49 if ((char ==
" ")
or (char ==
"\n"))
and abu.strip()!=
"":
52 abundances.append(float(abu.replace(
"D",
"e")))
54 idx = nuclei.index(
"al26")
55 if idx == len(abundances):
56 abundances.append(float(abu.replace(
"D",
"e")))
58 abundances[idx] = abundances[idx] + float(abu.replace(
"D",
"e"))
67 abundances = np.array(abundances)
68 nuclei = np.array(nuclei)
71 nm = nucleus_multiple(nuclei,X=abundances)
74 plt.plot(A,X,label=
"Mean composition\n(Jose & Hernanz 1998, model ONe5)")
77 Z,A,X = np.loadtxt(
"iniab.txt",unpack=
True,usecols=[0,2,3])
81 nm = nucleus_multiple(Z=Z,A=A,X=X)
83 plt.plot(A,X,label=
"Initial composition",ls=
"--")
87 A,Y,X = np.loadtxt(
"finabsum.dat",unpack=
True)
89 plt.plot(A,X,label=
"WinNet, single trajectory")
97 plt.legend(loc=
"upper right",bbox_to_anchor=(1.0,1.4))
98 plt.ylabel(
"Mass fraction")
99 plt.xlabel(
"Mass number")
100 plt.savefig(
'massfractions.pdf',bbox_inches=
'tight')