import mppnp as mp import utils import mesa as ms logdir='/rpod2/athira/mesa/case1/LOGS' p=ms.mesa_profile(logdir,100,num_type='model') cycles_1=p.log_ind.keys() cycles_1.sort() m=mp.se('/rpod2/athira/mppnp/case1/H5_out') #m=mp.se('/rpod2/athira/mppnp/RCB_0.7/H5_out') #index=[2000] matplotlib.rc('xtick',labelsize=15,color='k') matplotlib.rc('ytick',labelsize=12) matplotlib.rc('ytick.major',pad=15) matplotlib.rc('axes',labelsize=15,labelcolor='b') #lines=utils.symbol_list('lines2') #specs1a_l=['H-1','He-4','C-12','C-13','N-14','N-15','O-16','O-18','F-19','Ne-22'] specs1a_l=['$^1H$','$^4He$','$^{12}C$','$^{13}C$','$^{14}N$','$^{15}N$','$^{16}O$','$^{18}O$','$^{19}F$','$^{22}Ne$'] specs1b_l=['N-15','O-16','O-18','F-19','Ne-22'] specs2_l=['Na-23','Mg-24','Al-27','Si-28','S-32','Ca-40','Ti-48'] specs3_l=['Fe-56','Ni-58','Zn-64','Y-89','Zr-90','Ba-138','La-139'] #lines=['k-.','ro-','ks-','r--','k+:','rd-','k.-','r>-','kh-','rx-','k^-'] lines=['b--','ro-','bs-','k-.','r+:','bd-','kx--','r>-','kp-','r.:','m^-'] #index_1=arange(1,700,50) index_1=[1] for ind in index_1: neut_den_1=[] neut=m.get(ind,'Neutron-1') mass=m.get(ind,'mass') rho= m.get(ind,'rho') for a in range(len(neut)): res=(neut[a]*6*10**23*10**rho[a]) neut_den_1.append(res) h1=m.get(ind,'H-1');he4=m.get(ind,'He-4');c12=m.get(ind,'C-12');c13=m.get(ind,'C-13');n14=m.get(ind,'N-14') n15=m.get(ind,'N-15');o16=m.get(ind,'O-16');o18=m.get(ind,'O-18');f19=m.get(ind,'F-19');ne22=m.get(ind,'Ne-22') na23=m.get(ind,'Na-23');mg24=m.get(ind,'Mg-24');al27=m.get(ind,'Al-27');si28=m.get(ind,'Si-28');s32=m.get(ind,'S-32');ca40=m.get(ind,'Ca-40');ti48=m.get(ind,'Ti-48') fe56=m.get(ind,'Fe-56');ni58=m.get(ind,'Ni-58');zn64=m.get(ind,'Zn-64');y89=m.get(ind,'Y-89');zr90=m.get(ind,'Zr-90');ba138=m.get(ind,'Ba-138');la139=m.get(ind,'La-139') specs1a=[h1,he4,c12,c13,n14,n15,o16,o18,f19,ne22] specs1b=[n15,o16,o18,f19,ne22] specs2=[na23,mg24,al27,si28,s32,ca40,ti48] specs3=[fe56,ni58,zn64,y89,zr90,ba138,la139] close(ind+10) ifig=figure(ind+10,figsize=(10,7)) ax1=ifig.add_subplot(111) box = ax1.get_position() ax1.set_position([box.x0, box.y0, box.width * 0.90, box.height]) for a in range (len(specs1a)): ax1.semilogy(mass,specs1a[a],lines[a], label=specs1a_l[a],linewidth=2,markersize=6.2,alpha=0.60,markevery=15) ax1.legend(loc='center', bbox_to_anchor=(1.14, 0.23),prop={'size':11.0}) ax1.set_ylabel('Mass fraction') ax1.set_xlabel('$\mathrm{Mr/M_{\odot}}$') ylim(1e-8,1.2) xlim(0.0,0.90) text(0.25,1e-3,"Core (Hydro)",rotation=90,color='g',fontsize=12) text(0.458,4e-3,"IS Zone",rotation=90,color='g',fontsize=12) text(0.535,1e-3,"SOF",rotation=90,color='g',fontsize=12) text(0.75,8e-4,"Envelope",rotation=90,color='g',fontsize=12) savefig('mppnp_profile1a_'+'0'+str(ind)+'.png') savefig('mppnp_profile1a_'+'0'+str(ind)+'.pdf') savefig('mppnp_profile1a_'+'0'+str(ind)+'.eps') #close(ind+10) ''' close(ind+15) ifig=figure(ind+15,figsize=(10,7)) ax1=ifig.add_subplot(111) box = ax1.get_position() ax1.set_position([box.x0, box.y0, box.width * 0.83, box.height]) for a in range (len(specs1b)): ax1.semilogy(mass,specs1b[a],lines[a], label=specs1b_l[a],linewidth=2,markersize=6.2,alpha=0.7,markevery=15) #text(0.25,3e-4,"Core (Hydro)",rotation=90,color='g',fontsize=12) #text(0.458,3e-4,"IS Zone",rotation=90,color='g',fontsize=12) #text(0.535,3e-4,"SOF",rotation=90,color='g',fontsize=12) #text(0.75,6e-4,"Envelope",rotation=90,color='g',fontsize=12) ax1.legend(loc='center', bbox_to_anchor=(1.17, 0.17),prop={'size':10.0}) ax1.set_ylabel('Mass fraction') ax1.set_xlabel('$Mr/M_{\odot}$') ylim(1e-8,1.1) xlim(0.44,0.90) savefig('mppnp_profile1b_'+'0'+str(ind)+'.png') savefig('mppnp_profile1b_'+'0'+str(ind)+'.pdf') savefig('mppnp_profile1b_'+'0'+str(ind)+'.eps') close(ind+15) close(ind+110) ifig=figure(ind+110,figsize=(10,7)) ax1=ifig.add_subplot(111) box = ax1.get_position() ax1.set_position([box.x0, box.y0, box.width * 0.83, box.height]) for a in range (len(specs2)): ax1.semilogy(mass,specs2[a],lines[a], label=specs2_l[a],linewidth=2,markersize=6.2,alpha=0.7,markevery=15) ax1.legend(loc='center', bbox_to_anchor=(1.17, 0.17),prop={'size':10.0}) ax1.set_ylabel('Mass fraction') ax1.set_xlabel('$Mr/M_{\odot}$') ylim(1e-7,1e-3) xlim(0.44,0.90) savefig('mppnp_profile2_'+'0'+str(ind)+'.png') savefig('mppnp_profile2_'+'0'+str(ind)+'.pdf') savefig('mppnp_profile2_'+'0'+str(ind)+'.eps') close(ind+110) close(ind+210) ifig=figure(ind+210,figsize=(10,7)) ax1=ifig.add_subplot(111) box = ax1.get_position() ax1.set_position([box.x0, box.y0, box.width * 0.83, box.height]) for a in range (len(specs3)): ax1.semilogy(mass,specs3[a],lines[a], label=specs3_l[a],linewidth=2,markersize=6.2,alpha=0.7,markevery=15) ax1.legend(loc='center', bbox_to_anchor=(1.17, 0.17),prop={'size':10.0}) ax1.set_ylabel('Mass fraction') ax1.set_xlabel('$Mr/M_{\odot}$') ylim(1e-9,1e-2) xlim(0.44,0.90) ax2=ax1.twinx() ax2.plot(mass,log10(neut_den_1),linewidth=1.2,color='c') ylim(0,max(log10(neut_den_1)+1)) xlim(0.44,0.90) savefig('mppnp_profile3_'+'0'+str(ind)+'.png') savefig('mppnp_profile3_'+'0'+str(ind)+'.pdf') savefig('mppnp_profile3_'+'0'+str(ind)+'.eps') close(ind+210) '''