-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_models_Ge.py
More file actions
230 lines (220 loc) · 11.2 KB
/
read_models_Ge.py
File metadata and controls
230 lines (220 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
from nugridpy import nugridse as mp
import matplotlib.pyplot as pl
from numpy import log10
import pandas as pd
from collections import OrderedDict
#run=mp.se('../mppnp/z6m3/m2z6m3/H5_surf','surf.h5')
run1=mp.se('../mppnp/z1m2/m2z1m2/H5_surf','surf.h5')
#run2=mp.se('../mppnp/z2m2/m2z2m2/H5_surf','surf.h5')
#run3=mp.se('../mppnp/z3m2/m2z3m2/H5_surf','surf.h5')
run4=mp.se('../mppnp/z1m2/m3z1m2/H5_surf','surf.h5')
run5=mp.se('../mppnp/z2m2/m3z2m2/H5_surf','surf.h5')
#run5=mp.se('../mppnp/z2m2/m3z2m2/kadon1/H5_surf','surf.h5')
#run6=mp.se('../mppnp/z2m2/m3z2m2/kadon1_Ni/H5_surf','surf.h5')
#run6=mp.se('../mppnp/z3m2/m3z3m2/H5_surf','surf.h5')
#run2=mp.se('../mppnp/z1m2/m2z1m2_he07/H5_surf','surf.h5')
#run3=mp.se('../mppnp/z1m2/m2z1m2/H5_surf_critter','surf.h5')
#run4=mp.se('../mppnp/z2m2/m2z2m2_he07/H5_surf','surf.h5')
#run5=mp.se('../mppnp/z2m2/m2z2m2/H5_surf_critter','surf.h5')
#run6=mp.se('../mppnp/z1m2/m3z1m2_he07/H5_surf','surf.h5')
#run7=mp.se('../mppnp/z1m2/m3z1m2/H5_surf_critter','surf.h5')
#run8=mp.se('../mppnp/z2m2/m3z2m2_he07/H5_surf','surf.h5')
#run9=mp.se('../mppnp/z2m2/m3z2m2/H5_surf_critter','surf.h5')
#run_mass=[run1,run2,run3,run4,run5,run6,run7,run8,run9,run10,run11,run12,run13]
run_mass=[#run,
run1,#run2,run3,
run4,run5#,run6
]
metallicity_label=[#'$M3.z2m2$ $KADoNiS$ $1.0$','$M3.z2m2$ $KADoNiS$ $1.0,$ $0.9x$ ${^{58}}Ni(n,\gamma),$ $1.1x$ ${^{62}}Ni(n,\gamma)$']
#'$M3.z2m2$ $KADoNiS$ $0.3$','$M3.z2m2$ $KADoNiS$ $1.0$']
#'$M2.z6m3$',
'$M2.z1m2$',
#'$M2.z2m2$','$M2.z3m2$',
'$M3.z1m2$','$M3.z2m2$'#,'$M3.z3m2$'
]
#'$M2.z6m3\_hCBM$','$M3.z6m3\_hCBM$','$M2.z1m2\_hCBM$','$M2.z2m2\_hCBM$','$M3.z2m2\_hCBM$']
#'$M1p86.z2m2\_hCBM$','$M1p86.z2m2\_hCBM,$ $Ne22$','$M1p86.z2m2,$ $Ne22,$ $3x$ $Fe56(n,\gamma)$','$M2.z2m2$','$M2.z2m2\_hCBM$']
#'$M2.z1m2$','$M2.z2m2,$ $Ne22$ $\uparrow(\\alpha,\gamma)\downarrow(\\alpha,n)$','$M2.z1m2,$ $Ne22,$ $3x$ $Fe56(n,\gamma)$','$M2.z1m2,$ $Ne22,$ $2x$ $Fe56(n,\gamma)$','$M2.z1m2,$ $Ne22,$ $1.5x$ $Fe56(n,\gamma)$',\
#'$M2.z1m2\_hCBM$','$M2.z1m2\_hCBM,$ $Ne22$ $\uparrow(\\alpha,\gamma)\downarrow(\\alpha,n)$','$M2.z1m2\_hCBM,$ $Ne22,$ $3x$ $Fe56(n,\gamma)$','$M2.z1m2\_hCBM,$ $Ne22,$ $2x$ $Fe56(n,\gamma)$','$M2.z1m2\_hCBM,$ $Ne22,$ $`1.5x$ $Fe56(n,\gamma)$']
#'$M2.z1m2,$ $Ne22,$ $1.5x$ $Fe56(n,\gamma)$','$M2.z1m2,$ $Ne22,$ $2x$ $Fe56(n,\gamma)$','$M2.z1m2,$ $1.15x$ $Fe56(n,\gamma)$','$M2.z1m2,$ $Ne22,$ $3x$ $Fe56(n,\gamma)$']
#'$M3.z2m2\_he07$','$M3.z2m2\_he07,$ $Longland$ $22$','$M3.z2m2\_he07,$ $Longland$ $13$','$M3.z2m2\_he07,$ $Longland$ $31$']
#'$M1p65.z2m2$','$M2.z2m2$','$M3.z2m2$']
#'$M2.z2m2$','$M2.z2m2,$ $Ritter$ $et$ $al.$ $2017$']
#['$M1p65.z2m2$','$M1p65.z2m2,$ $Ritter$ $et$ $al.$ $2017$','$M3.z1m2\_lowres$','$M3.z1m2$','$M3.z1m2,$ $Ritter$ $et$ $al.$ $2017$']
#['$M2.z1m2\_he07$','$M2.z1m2\_R17$','$M2.z2m2\_he07$','$M2.z2m2\_R17$','$M3.z1m2\_he07$','$M3.z1m2\_R17$','$M3.z2m2\_he07$','$M3.z2m2\_R17$'] ## legend labels
sparcity_sindex=2000 ## sparcity to adopt reading s-process index data
sparcity_isoratio=2000 ## sparcity to adopt reading isotopic ratio data
markers=['k','tab:blue', 'tab:cyan', 'tab:green', 'tab:olive', 'tab:gray', 'tab:brown', 'y', 'tab:purple', 'tab:pink', 'tab:orange','tab:red']## markers to use while plotting s-process indices
symbols=['h','s','^','>','D','<','p','d','^','s','o'] ## linestyles to use while plotting s-process indices
ls_element = ['Sr-84','Sr-86','Sr-87','Sr-88','Y-89','Zr-90','Zr-91','Zr-92','Zr-94','Zr-96']
hs_element = ['Ba-130','Ba-132','Ba-134','Ba-135','Ba-136','Ba-137','Ba-138','La-138','La-139','Nd-142','Nd-143','Nd-144','Nd-145','Nd-146','Nd-148','Nd-150','Sm-144','Sm-147','Sm-148','Sm-149','Sm-150','Sm-152','Sm-154']
# notice that Pb (3rd s-process index) is not included here.
s_element = ['Sr-84','Sr-86','Sr-87','Sr-88','Y-89','Zr-90','Zr-91','Zr-92','Zr-94','Zr-96','Ba-130','Ba-132','Ba-134','Ba-135','Ba-136','Ba-137','Ba-138','La-138','La-139','Nd-142','Nd-143','Nd-144','Nd-145','Nd-146','Nd-148','Nd-150','Sm-144','Sm-147','Sm-148','Sm-149','Sm-150','Sm-152','Sm-154']
s_ini = []
ls_ini = []
hs_ini = []
fe_ini = []
ge_ini = []
for i in run_mass:
dum_s_ini = 0.
dum_ls_ini = 0.
dum_hs_ini = 0.
dum_fe_ini = 0.
dum_ge_ini = 0.
dum_fe_ini = float(i.se.get(min(i.se.cycles),'iso_massf','Fe-54'))+float(i.se.get(min(i.se.cycles),'iso_massf','Fe-56'))+float(i.se.get(min(i.se.cycles),'iso_massf','Fe-57'))+float(i.se.get(min(i.se.cycles),'iso_massf','Fe-58'))
dum_ge_ini = float(i.se.get(min(i.se.cycles),'iso_massf','F-19'))#+float(i.se.get(min(i.se.cycles),'iso_massf','Ge-72'))+float(i.se.get(min(i.se.cycles),'iso_massf','Ge-73'))+float(i.se.get(min(i.se.cycles),'iso_massf','Ge-74'))+float(i.se.get(min(i.se.cycles),'iso_massf','Ge-76'))
for j in ls_element:
dum_ls_ini = dum_ls_ini + float(i.se.get(min(i.se.cycles),'iso_massf',j))
for j in hs_element:
dum_hs_ini = dum_hs_ini + float(i.se.get(min(i.se.cycles),'iso_massf',j))
for j in s_element:
dum_s_ini = dum_s_ini + float(i.se.get(min(i.se.cycles),'iso_massf',j))
fe_ini.append(dum_fe_ini)
ls_ini.append(dum_ls_ini) # /float(len(ls_element)))
hs_ini.append(dum_hs_ini) #/float(len(hs_element)))
s_ini.append(dum_s_ini) #/float(len(s_element)))
ge_ini.append(dum_ge_ini)
# sparcity for cycles I am looking at.
sparsity = sparcity_sindex
s_fe = []
ls_fe = []
hs_fe = []
hs_ls = []
fe_h = []
ge_fe = []
s_fe_tps = []
ls_fe_tps = []
hs_fe_tps = []
hs_ls_tps = []
fe_h_tps = []
ge_fe_tps = []
s_fe_tps_co = []
ls_fe_tps_co = []
hs_fe_tps_co = []
hs_ls_tps_co = []
fe_h_tps_co = []
ge_fe_tps_co = []
k = 0
for i in run_mass:
jjjj=0
dum_s_fe = []
dum_ls_fe = []
dum_hs_fe = []
dum_hs_ls = []
dum_fe_h = []
dum_ge_fe = []
dum_s_fe_tps = []
dum_ls_fe_tps = []
dum_hs_fe_tps = []
dum_hs_ls_tps = []
dum_fe_h_tps = []
dum_ge_fe_tps = []
dum_s_fe_tps_co = []
dum_ls_fe_tps_co = []
dum_hs_fe_tps_co = []
dum_hs_ls_tps_co = []
dum_fe_h_tps_co = []
dum_ge_fe_tps_co = []
dum_co=[]
for j in i.se.cycles[0::sparsity]:
dum_s = 0.
dum_ls = 0.
dum_hs = 0.
dum_fe = 0.
dum_ge = 0.
dum_c = 0.
dum_o = 0.
print(j)
dum_fe = float(i.se.get(j,'iso_massf','Fe-54'))+float(i.se.get(j,'iso_massf','Fe-56'))+float(i.se.get(j,'iso_massf','Fe-57'))+float(i.se.get(j,'iso_massf','Fe-58'))
dum_ge = float(i.se.get(j,'iso_massf','Ge-70'))+float(i.se.get(j,'iso_massf','Ge-72'))+float(i.se.get(j,'iso_massf','Ge-73'))+float(i.se.get(j,'iso_massf','Ge-74'))+float(i.se.get(j,'iso_massf','Ge-76'))
dum_c = float(i.se.get(j,'iso_massf','C-12'))
dum_o = float(i.se.get(j,'iso_massf','O-16'))
dum_c=(float((i.se.get((int(j)),'iso_massf','C-12')))+float((i.se.get(j,'iso_massf','C-13'))))
dum_o=(float((i.se.get((int(j)),'iso_massf','O-16')))+float((i.se.get(j,'iso_massf','O-17'))))
dum_co.append(((dum_c/dum_o)*(16./12.)))
for jj in ls_element:
dum_ls = dum_ls + float(i.se.get(j,'iso_massf',jj)) #/float(len(ls_element)))
for jj in hs_element:
dum_hs = dum_hs + float(i.se.get(j,'iso_massf',jj)) #/float(len(hs_element)))
for jj in s_element:
dum_s = dum_s + float(i.se.get(j,'iso_massf',jj)) #/float(len(s_element)))
dum_s_fe.append(log10((dum_s/dum_fe)/(s_ini[k]/fe_ini[k])))
dum_ls_fe.append(log10((dum_ls/dum_fe)/(ls_ini[k]/fe_ini[k])))
dum_hs_fe.append(log10((dum_hs/dum_fe)/(hs_ini[k]/fe_ini[k])))
dum_hs_ls.append(log10((dum_hs/dum_ls)/(hs_ini[k]/ls_ini[k])))
dum_fe_h.append(log10((float(i.se.get('zini')))/(0.018)))
#dum_rb_fe.append(log10((dum_rb/dum_fe)/(rb_ini[k]/fe_ini[k]))-0.2) ## correction for Lambert 1995 data
dum_ge_fe.append(log10((dum_ge/dum_fe)/(ge_ini[k]/fe_ini[k]))-0.068) ## correction for Zamora 2009 data
if (len(dum_co)>1):
if (dum_co[len(dum_co)-1]>(dum_co[len(dum_co)-2]+0.02)):
dum_s_fe_tps.append(log10((dum_s/dum_fe)/(s_ini[k]/fe_ini[k])))
dum_ls_fe_tps.append(log10((dum_ls/dum_fe)/(ls_ini[k]/fe_ini[k])))
dum_hs_fe_tps.append(log10((dum_hs/dum_fe)/(hs_ini[k]/fe_ini[k])))
dum_hs_ls_tps.append(log10((dum_hs/dum_ls)/(hs_ini[k]/ls_ini[k])))
dum_fe_h_tps.append(log10((float(i.se.get('zini')))/(0.018)))
#dum_rb_fe_tps.append(log10((dum_rb/dum_fe)/(rb_ini[k]/fe_ini[k]))-0.2) ## correction for Lambert 1995 data
dum_ge_fe_tps.append(log10((dum_ge/dum_fe)/(ge_ini[k]/fe_ini[k]))-0.068) ## correction for Zamora 2009 data
if (dum_co[len(dum_co)-1]>1.):
dum_s_fe_tps_co.append(log10((dum_s/dum_fe)/(s_ini[k]/fe_ini[k])))
dum_ls_fe_tps_co.append(log10((dum_ls/dum_fe)/(ls_ini[k]/fe_ini[k])))
dum_hs_fe_tps_co.append(log10((dum_hs/dum_fe)/(hs_ini[k]/fe_ini[k])))
dum_hs_ls_tps_co.append(log10((dum_hs/dum_ls)/(hs_ini[k]/ls_ini[k])))
dum_fe_h_tps_co.append(log10((float(i.se.get('zini')))/(0.018)))
dum_ge_fe_tps_co.append(log10((dum_ge/dum_fe)/(ge_ini[k]/fe_ini[k]))-0.068) ## correction for Zamora 2009 data
jjjj=jjjj+1
s_fe.append(dum_s_fe)
ls_fe.append(dum_ls_fe)
hs_fe.append(dum_hs_fe)
hs_ls.append(dum_hs_ls)
fe_h.append(dum_fe_h)
ge_fe.append(dum_ge_fe)
s_fe_tps.append(dum_s_fe_tps)
ls_fe_tps.append(dum_ls_fe_tps)
hs_fe_tps.append(dum_hs_fe_tps)
hs_ls_tps.append(dum_hs_ls_tps)
fe_h_tps.append(dum_fe_h_tps)
ge_fe_tps.append(dum_ge_fe_tps)
s_fe_tps_co.append(dum_s_fe_tps_co)
ls_fe_tps_co.append(dum_ls_fe_tps_co)
hs_fe_tps_co.append(dum_hs_fe_tps_co)
hs_ls_tps_co.append(dum_hs_ls_tps_co)
fe_h_tps_co.append(dum_fe_h_tps_co)
ge_fe_tps_co.append(dum_ge_fe_tps_co)
k = k+1
mass_label =[]
for i in run_mass:
mass_label.append(float(i.se.get('mini')))
params = {'text.usetex': True,
'xtick.direction': 'in',
'ytick.direction': 'in',
'axes.linewidth' : 5,
'xtick.major.size': 20,
'ytick.major.size': 20,
'xtick.labelsize': 30,
'ytick.labelsize': 30,
'ytick.major.pad': 5,
'ytick.major.width': 3,
'xtick.major.pad': 5,
'xtick.major.width': 3}
pl.rcParams.update(params)
pl.tick_params(axis='both', pad=5,direction='in')
# Axes object: one row, one column, first plot (one plot!)
fig = pl.figure(1) # Figure object
ax = fig.add_subplot(1,1,1)
array_to_plot_x_tps = s_fe_tps
array_to_plot_x_co = s_fe_tps_co
array_to_plot_y_tps = ge_fe_tps
array_to_plot_y_co = ge_fe_tps_co
pl.axhline(y=0,linewidth=5, color='k')
pl.axvline(x=0,linewidth=5, color='k')
for k in range(0,len(array_to_plot_x_tps)):
pl.plot(array_to_plot_x_tps[k],array_to_plot_y_tps[k],marker=symbols[k],c=markers[k],ls='-',markersize=10.,linewidth=2.)
pl.plot(array_to_plot_x_co[k],array_to_plot_y_co[k],marker=symbols[k],c=markers[k],ls='-',markersize=20.,linewidth=2.,label=str(metallicity_label[k]))
handles, labels = pl.gca().get_legend_handles_labels()
by_label = OrderedDict(zip(labels, handles))
pl.legend(by_label.values(), by_label.keys(),prop={'size':25})
pl.xlabel('$[s/Fe]$', fontsize=40)
pl.ylabel('$[F/Fe]$', fontsize=40)
pl.xlim(-0.6,1.7)
pl.ylim(-0.6,1)
pl.show()