Plotting functions are called in the order as they appear in the code. Each field calls first the function with default input and then with user-specified input. You can find the documentation here.
$\odot$ Plotting functions tests
In [1]:
#from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
#import mpld3
#mpld3.enable_notebook()
import sygma as s
reload(s)
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
s1=s.sygma(iniZ=0.02,dt=1e7,tend=2e7)
In [3]:
s1.plot_yield_input() #[1,3,5,12][Fe/H]
s1.plot_yield_input(fig=2,xaxis='mini',yaxis='[Fe/H]',iniZ=0.0001,masses=[1,3,12,25],marker='s',color='r',shape='-')
s1.plot_yield_input(fig=3,xaxis='[C/H]',yaxis='[Fe/H]',iniZ=0.0001,masses=[1,3,12,25],marker='x',color='b',shape='--')
The following commands plot the ISM metallicity in spectroscopic notation.
In [4]:
s1.plot_mass()
s1.plot_mass(specie='N',shape='--',marker='x')
In [5]:
#s1.plot_mass_multi()
#s1.plot_mass_multi(fig=1,specie=['C','N'],ylims=[],source='all',norm=False,label=[],shape=['-','--'],marker=['o','D'],color=['r','b'],markevery=20)
#plt.legend()
In [ ]:
In [6]:
s1.plot_massfrac()
s1.plot_massfrac(yaxis='He-4',shape='--',marker='x')
In [7]:
s1.plot_spectro()
s1.plot_spectro(yaxis='[O/Fe]',marker='x',shape='--')
In [8]:
s1.plot_totmasses()
s1.plot_totmasses(source='agb',shape='--',marker='x')
s1.plot_totmasses(mass='stars',shape=':',marker='^')
In [9]:
import sygma as s
reload(s)
s1=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='salpeter',imf_bdys=[1,30],special_timesteps=-1,hardsetZ=0.0001,table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=True, sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn',pop3_table='yield_tables/popIII_h1.txt')
In [10]:
#s1.plot_sn_distr(rate=True,label1='SN1a, rate',label2='SNII, rate',marker1='o',marker2='s')
s1.plot_sn_distr(fig=4,rate=False,label1='SN1a, number',label2='SNII number',marker1='d',marker2='p')
##plt.xlim(1e6,1e10)
#plt.ylabel('Number/Rate')
s1.plot_sn_distr()
s1.plot_sn_distr(fig=5,rate=True,rate_only='',xaxis='time',label1='SN1a',label2='SN2',shape1=':',shape2='--',marker1='o',marker2='s',color1='k',color2='b',markevery=20)
In [11]:
#s1=s.sygma(iolevel=0,mgal=1e11,dt=1e6,tend=1.3e10,imf_type='salpeter',imf_bdys=[1,30],special_timesteps=-1,iniZ=-1,hardsetZ=0.0001,table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=True, sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn',pop3_table='yield_tables/popIII_h1.txt')
In [12]:
#s1.plot_sn_distr(rate=True,label1='SN1a, rate',label2='SNII, rate',marker1='o',marker2='s')
#s1.plot_sn_distr(rate=False,label1='SN1a, number',label2='SNII number',marker1='d',marker2='p')
#plt.xlim(1e6,1e10)
#plt.ylabel('Number/Rate')
In [13]:
#s1=s.sygma(iniZ=0.0001,dt=1e9,tend=2e9)
#s2=s.sygma(iniZ=0.02)#,dt=1e7,tend=2e9)
reload(s)
s1=s.sygma(iolevel=0,iniZ=0.02,dt=1e8,tend=1e9) #standart not workign
#s2=s.sygma(iniZ=0.02,dt=1e8,tend=1e10)
In [14]:
s1.plot_mass_range_contributions()
s1.plot_mass_range_contributions(fig=7,specie='O',rebin=0.5,label='',shape='-',marker='o',color='b',markevery=20,extralabel=False,log=False)
#s1.plot_mass_range_contributions(fig=7,specie='O',prodfac=True,rebin=0.5,label='',shape='-',marker='o',color='r',markevery=20,extralabel=False,log=False)
In [15]:
import sygma as s
reload(s)
ssp1=s.sygma(iolevel=0,dt=1e8,mgal=1e11,starbursts=[0.1,0.1],tend=1e9,special_timesteps=-1,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_on=False,hardsetZ=0.0001,table='yield_tables/isotope_yield_table_h1.txt', sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
In [ ]:
ssp1.plot_star_formation_rate()
ssp1.plot_star_formation_rate(fig=6,marker='o',shape=':')
In [ ]:
ssp1.plot_mass_range_contributions(fig=7,specie='H',prodfac=False,rebin=-1,time=-1,label='Total burst',shape='-',marker='o',color='r',markevery=20,extralabel=False,log=False)
ssp1.plot_mass_range_contributions(fig=7,specie='H',prodfac=False,rebin=-1,time=1e8,label='Burst at 1e8',shape='-',marker='o',color='b',markevery=20,extralabel=False,log=False)
In [ ]:
#s1.write_evol_table(elements=['H','He','C'])
s1.write_evol_table(elements=['H'],isotopes=['H-1'],table_name='gce_table.txt',interact=False)
In [ ]: