<jupyter_start><jupyter_text>How to use different extra sources such as CCSN neutrino-driven winds Prepared by <NAME><jupyter_code>%matplotlib nbagg
import matplotlib.pyplot as plt
import sys
import sygma as s
import omega as o
import numpy as np
print (s.global_path)
import read_yields as ry
import matplotlib<jupyter_output>/Users/benoitcote/Desktop/OMEGA_SYGMA_inheritance/<jupyter_text>AGB and massive star tables used<jupyter_code>table='yield_tables/agb_and_massive_stars_nugrid_MESAonly_fryer12delay.txt'<jupyter_output><empty_output><jupyter_text>Setup<jupyter_code># OMEGA parameters for MW
mass_loading = 0.0
nb_1a_per_m = 3.0e-3
sfe=0.04
SF_law=True
DM_evolution=False
imf_yields_range=[1.0,30.0]
special_timesteps=30
Z_trans=0.0
iniZ=0.0001<jupyter_output><empty_output><jupyter_text>Default setup<jupyter_code>o0=o.omega(iniZ=iniZ,galaxy='milky_way',Z_trans=Z_trans, table=table,sfe=sfe, DM_evolution=DM_evolution,\
                  mass_loading=mass_loading, nb_1a_per_m=nb_1a_per_m, special_timesteps=special_timesteps,
                  imf_yields_range=imf_yields_range,
                SF_law=SF_law)<jupyter_output>OMEGA run in progress..
..Time refinement..
   OMEGA run completed - Run time: 1.54s<jupyter_text>Setup with different extra sources Here we use yields in two (extra source) yield tables which we apply in the mass range from 8Msun to 12Msun and from 12Msun to 30Msun respectively. We apply a factor of 0.5 to the extra yields of the first yield table and 1. to the second yield table.<jupyter_code>extra_source_table=['yield_tables/mhdjet_NTT_delayed.txt','yield_tables/ndw_wind_expand.001.txt']
#Apply yields only in specific mass ranges;
extra_source_mass_range = [[8,12],[12,30]]
#percentage of stars to which the yields are added. First entry for first yield table etc.
f_extra_source = [0.5,1.]
#metallicity to exclude (in this case none)
extra_source_exclude_Z = [[], []]
#you can look at the yields directly with the y1 and y2 parameter below.
y1=ry.read_yield_sn1a_tables(s.global_path+extra_source_table[0])
y2=ry.read_yield_sn1a_tables(s.global_path+extra_source_table[1])<jupyter_output><empty_output><jupyter_text>SYGMA<jupyter_code>s0 = s.sygma(iniZ=0.0001,extra_source_on=False) #default False
s0p1 = s.sygma(iniZ=0.0001,extra_source_on=True,
             extra_source_table=extra_source_table,extra_source_mass_range=extra_source_mass_range,
           f_extra_source=f_extra_source, extra_source_exclude_Z=extra_source_exclude_Z)<jupyter_output>SYGMA run in progress..
   SYGMA run completed - Run time: 0.51s<jupyter_text>OMEGA<jupyter_code>o0p1=o.omega(iniZ=iniZ,galaxy='milky_way',Z_trans=Z_trans, table=table,sfe=sfe, DM_evolution=DM_evolution,\
                  mass_loading=mass_loading, nb_1a_per_m=nb_1a_per_m, special_timesteps=special_timesteps,
                  imf_yields_range=imf_yields_range,SF_law=SF_law,extra_source_on=True,
           extra_source_table=extra_source_table,extra_source_mass_range=extra_source_mass_range,
           f_extra_source=f_extra_source, extra_source_exclude_Z=extra_source_exclude_Z)<jupyter_output>OMEGA run in progress..
..Time refinement..
   OMEGA run completed - Run time: 1.81s
{'fraction_non_alphanumeric': 0.08545397423814012, 'fraction_numerical': 0.026704366949418787, 'mean_word_length': 6.236363636363636, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '214947', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1177, 'n_words': 221, 'path': 'DOC/Teaching/ExtraSources.ipynb', 'repo_name': 'katewomack/NuPyCEE', 'size': '3193'}