def pocket_composition(self,mp,sefiles,cycle,massbot,masstop,isotopes,label,legend,color,title): ###hdf5out
'''
mass_range - required to plot data in a certain mass range. Needed for read_iso_abund_marco
cycle - which cycle from the h5 file?. Needed for read_iso_abund_marco
stable - logic if want to plot only stable or not.
i_decay - if = 1 I plot not decayed, if = 2 I plot decayed. Make sense only if stable is true.
'''
mass_range=[massbot,masstop]
sefiles.average_iso_abund_marco(mass_range,cycle,stable=False,i_decay=1)
mass=[]
plotiso=[]
startyields=[]
plotiso_massfrac=[]
for i in range(len(isotopes)):
startyields.append(sefiles.get(sefiles.se.cycles[0],isotopes[i])[0])
for j in range(len(sefiles.se.isotopes)):
if sefiles.se.isotopes[j] in isotopes:
plotiso.append(mp.average_mass_frac[j])
mass.append(sefiles.se.A[j])
for i in range(len(isotopes)):
plotiso_massfrac.append(plotiso[i]/startyields[i])
plt.plot(mass,plotiso_massfrac,marker='*',markersize=8,mfc=color,linestyle='None',label=legend)
#plt.plot(mass,plotiso_massfrac,marker='*')
if label ==True:
for j in range(len(isotopes)):
plt.annotate(isotopes[j], xytext = (0, 10),textcoords = 'offset points' ,xy=(mass[j], plotiso_massfrac[j]))
mass=np.array(mass)
plt.xlim(mass.min()-4,mass.max()+4)
plt.legend()
plt.title(title)
plt.xlabel("mass number")
plt.ylabel("Isotopic production factors")
评论列表
文章目录