#Falk wants to have not only the CNO isotopes #in the paper but also the elements; here you can choose both import nugrid_set as set cycles=20*[[1,-1,200]] dum_iso_num=5000 import sys sys.setrecursionlimit(50000) mesaonly=True mcut='fryer' ###the option mcut='ye' needs changes below, because of different save dir exp_type='delay' isotopes=True #isotopes or elements? also adapt iso or ele arrays below plot_log=True color=['r','b','g','k'] marker_type=['o','p','s','D'] line_style=['--','-','-.',':'] xmin=1 xmax=25 if isotopes==True: isotopes=['allstable'] elements=[] else: elements=['allstable'] isotopes=[] isotopes=["C-12","N-14","O-16"] #elements=["C","N","O"] wind_only=False pre_exp=False exp_only=False path='/apod2/NuGrid/data/set1ext/' ###############set1.2 mesa expdir=path+'/set1.2/ppd_exp/' setdir=path+'/set1.2/ppd_wind/' setse=set.mppnp_set(rundir=setdir) if mcut == 'ye': fallback_masses=[12,15,20,25];fallback_coords=[2.07,4.3,6.46,8.9] else: fallback_masses=[];fallback_coords=[] setse.get_stellar_ejecta(cycles=cycles,isotopes=isotopes,elements=elements,yields_output=False,GCE_tables=False,plots=True,exp_dir=expdir,exp_type=exp_type,pre_exp=pre_exp,exp_only=exp_only,wind_only=wind_only,plot_log=plot_log,color=dum_iso_num*['r'],marker_type=dum_iso_num*['o'],line_style=dum_iso_num*['--'],markersize=dum_iso_num*[8],line_width=dum_iso_num*[8],title='',label='',withlabel=True) ####################set1.1 mesa expdir=path+'/set1.1/ppd_exp/' setdir=path+'/set1.1/ppd_wind/' setse=set.mppnp_set(rundir=setdir) if mcut == 'ye': fallback_masses=[12,15,20,25];fallback_coords=[2.12,3.12,4.97,2.6] else: fallback_masses=[];fallback_coords=[] setse.get_stellar_ejecta(cycles=cycles,isotopes=isotopes,elements=elements,yields_output=False,GCE_tables=False,plots=True,exp_dir=expdir,exp_type=exp_type,pre_exp=pre_exp,exp_only=exp_only,wind_only=wind_only,plot_log=plot_log,color=dum_iso_num*['b'],marker_type=dum_iso_num*['p'],line_style=dum_iso_num*['-'],markersize=dum_iso_num*[8],line_width=dum_iso_num*[8],title='',label='',withlabel=True) ####################set1.3a expdir=path+'/set1.3a/ppd_exp/' setdir=path+'/set1.3a/ppd_wind/' setse=set.mppnp_set(rundir=setdir) if mcut == 'ye': fallback_masses=[12,15,20,25];fallback_coords=[1.71,2.01,2.55,1.99] else: fallback_masses=[];fallback_coords=[] setse.get_stellar_ejecta(cycles=cycles,isotopes=isotopes,elements=elements,yields_output=False,GCE_tables=False,plots=True,exp_dir=expdir,exp_type=exp_type,pre_exp=pre_exp,exp_only=exp_only,wind_only=wind_only,plot_log=plot_log,color=dum_iso_num*['g'],marker_type=dum_iso_num*['s'],line_style=dum_iso_num*['-.'],markersize=dum_iso_num*[8],line_width=dum_iso_num*[8],title='',label='',withlabel=True) ####################set1.4a expdir=path+'/set1.4a/ppd_exp/' setdir=path+'/set1.4a/ppd_wind/' setse=set.mppnp_set(rundir=setdir) if mcut == 'ye': fallback_masses=[12,15,20,25];fallback_coords=[1.71,1.79,2.39,2.02] else: fallback_masses=[];fallback_coords=[] setse.get_stellar_ejecta(cycles=cycles,isotopes=isotopes,elements=elements,yields_output=False,GCE_tables=False,plots=True,exp_dir=expdir,exp_type=exp_type,pre_exp=pre_exp,exp_only=exp_only,wind_only=wind_only,plot_log=plot_log,color=dum_iso_num*['k'],marker_type=dum_iso_num*['D'],line_style=dum_iso_num*[':'],markersize=dum_iso_num*[8],line_width=dum_iso_num*[8],title='',label='',withlabel=True) ####################set1.5a expdir=path+'/set1.5a/ppd_exp/' setdir=path+'/set1.5a/ppd_wind/' setse=set.mppnp_set(rundir=setdir) if mcut == 'ye': fallback_masses=[12,15,20,25];fallback_coords=[1.71,1.79,2.39,2.02] else: fallback_masses=[];fallback_coords=[] setse.get_stellar_ejecta(cycles=cycles,isotopes=isotopes,elements=elements,yields_output=False,GCE_tables=False,plots=True,exp_dir=expdir,exp_type=exp_type,pre_exp=pre_exp,exp_only=exp_only,wind_only=wind_only,plot_log=plot_log,color=dum_iso_num*['m'],marker_type=dum_iso_num*['v'],line_style=dum_iso_num*['--'],markersize=dum_iso_num*[8],line_width=dum_iso_num*[8],title='',label='',withlabel=True) ##################### Plotting figures=[manager.canvas.figure for manager in matplotlib._pylab_helpers.Gcf.get_all_fig_managers()] print 'calculatoin done' print 'Save figures...' props = dict(boxstyle='square', facecolor='w', alpha=1) i=0 for fig in figures: if not i==0: plt.legend().set_visible(False) i=i+1 isotope=fig.get_label() name=isotope+"_prodfac" fig=plt.figure(isotope); ax = fig.add_subplot(111) ax.text(0.85, 0.92, isotope, transform=ax.transAxes, fontsize=16,verticalalignment='top', bbox=props) plt.xlim(xmin,xmax) #fig.set_size_inches(18.5,10.5) #plt.show() plt.xscale('log') plt.ylabel('Overproduction factor') if isotope == 'C-12': plt.ylim(5e-2,1e4) plt.legend().set_visible(False) plt.savefig('C-12_prodfac_zdep.png') elif isotope == 'N-14': plt.legend().set_visible(False) plt.ylim(5e-1,1e4) plt.savefig('N-14_prodfac_zdep.png') else: plt.legend(loc=2,fontsize=15) plt.ylim(1e-1,1e4) plt.savefig('O-16_prodfac_zdep.png')