<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 How to use different extra sources such as CCSN neutrino-driven winds
Prepared by Christian Ritter
Step1:  AGB and massive star tables used
Step2:  Setup
Step3:  Default setup
Step4:  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.
Step5:  SYGMA
Step6:  OMEGA
<ASSISTANT_TASK:>
Python Code:
%matplotlib nbagg
import matplotlib.pyplot as plt
import sys
import matplotlib
import numpy as np
from NuPyCEE import sygma as s
from NuPyCEE import omega as o
from NuPyCEE import read_yields as ry
Explanation: How to use different extra sources such as CCSN neutrino-driven winds
Prepared by Christian Ritter
End of explanation
table='yield_tables/agb_and_massive_stars_nugrid_MESAonly_fryer12delay.txt'
Explanation: AGB and massive star tables used
End of explanation
# 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
Explanation: Setup
End of explanation
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)
Explanation: Default setup
End of explanation
extra_source_table=['yield_tables/r_process_arnould_2007.txt',
                    'yield_tables/r_process_arnould_2007.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_yields_Z("./NuPyCEE/"+extra_source_table[0])
y2=ry.read_yields_Z("./NuPyCEE/"+extra_source_table[1])
Explanation: 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.
End of explanation
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)
Explanation: SYGMA
End of explanation
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)
Explanation: OMEGA
End of explanation
<END_TASK>