import mppnp as mp import utils import mesa as ms logdir='/rpod2/athira/mesa/case9/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/case9/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'] #lines=['k-.','ro-','ks-','r--','k+:','rd-','k.-','r>-','kh-','rx-','k^-'] lines=['k--','ro-','bs-','r-.','b+:','bd-','kx--','r>-','rp-','r.:','m^-'] index_1=arange(1,3000,50) #index_1=[1150] 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') specs1a=[h1,he4,c12,c13,n14,n15,o16,o18,f19,ne22] specs1b=[n15,o16,o18,f19,ne22] 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.70,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.44,0.90) #text(0.25,1e-3,"Core (Hydro)",rotation=90,color='k',fontsize=12) #text(0.458,4e-3,"IS Zone",rotation=90,color='k',fontsize=12) #text(0.535,1e-3,"SOF",rotation=90,color='k',fontsize=12) #text(0.75,8e-4,"Envelope",rotation=90,color='k',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)