<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 This notebook will help you to access the chemical abundance tracks that you see in paper 1 figure 17 but for all elements. You can use it to compare it to your own model/data.
Step1:  We load the results from the best parameter Chempy run
Step2:  These are the available elements (not all are trustworthy)
Step3:  These are the corresponding time-steps in Gyrs, 13.5 being present-day.
Step4:  Here is how you can plot them
Step5:  You can do this for all the available elements.
I would see the results for [Fe/H] < 1 as rough extrapolations.
Beware that you have to weight in the SFR and age-distribution of your tracer stars if you want to compare e.g. to metallicity distribution function. See https
Step6:  You can of course also compare to all other values saved in the cube e.g. SN rates or sfr/gas/stellar mass
<ASSISTANT_TASK:>
Python Code:
%pylab inline
Explanation: This notebook will help you to access the chemical abundance tracks that you see in paper 1 figure 17 but for all elements. You can use it to compare it to your own model/data.
End of explanation
# Single zone models for sun, arcturus and cas with default and alternative yield set
sun_def_ab = np.load('data/paper_1_abundance_tracks/single_sun_default_abundances.npy')
sun_def_cube = np.load('data/paper_1_abundance_tracks/single_sun_default_cube.npy')
sun_alt_ab = np.load('data/paper_1_abundance_tracks/single_sun_alternative_abundances.npy')
sun_alt_cube = np.load('data/paper_1_abundance_tracks/single_sun_alternative_cube.npy')
arc_def_ab = np.load('data/paper_1_abundance_tracks/single_arc_default_abundances.npy')
arc_def_cube = np.load('data/paper_1_abundance_tracks/single_arc_default_cube.npy')
arc_alt_ab = np.load('data/paper_1_abundance_tracks/single_arc_alternative_abundances.npy')
arc_alt_cube = np.load('data/paper_1_abundance_tracks/single_arc_alternative_cube.npy')
cas_def_ab = np.load('data/paper_1_abundance_tracks/single_cas_default_abundances.npy')
cas_def_cube = np.load('data/paper_1_abundance_tracks/single_cas_default_cube.npy')
cas_alt_ab = np.load('data/paper_1_abundance_tracks/single_cas_alternative_abundances.npy')
cas_alt_cube = np.load('data/paper_1_abundance_tracks/single_cas_alternative_cube.npy')
# multizone models for sun, arcturus and cas with default and alternative yield set
mult_sun_def_ab = np.load('data/paper_1_abundance_tracks/sun_default_abundances.npy')
mult_sun_def_cube = np.load('data/paper_1_abundance_tracks/sun_default_cube.npy')
mult_sun_alt_ab = np.load('data/paper_1_abundance_tracks/sun_alternative_abundances.npy')
mult_sun_alt_cube = np.load('data/paper_1_abundance_tracks/sun_alternative_cube.npy')
mult_arc_def_ab = np.load('data/paper_1_abundance_tracks/arc_default_abundances.npy')
mult_arc_def_cube = np.load('data/paper_1_abundance_tracks/arc_default_cube.npy')
mult_arc_alt_ab = np.load('data/paper_1_abundance_tracks/arc_alternative_abundances.npy')
mult_arc_alt_cube = np.load('data/paper_1_abundance_tracks/arc_alternative_cube.npy')
mult_cas_def_ab = np.load('data/paper_1_abundance_tracks/cas_default_abundances.npy')
mult_cas_def_cube = np.load('data/paper_1_abundance_tracks/cas_default_cube.npy')
mult_cas_alt_ab = np.load('data/paper_1_abundance_tracks/cas_alternative_abundances.npy')
mult_cas_alt_cube = np.load('data/paper_1_abundance_tracks/cas_alternative_cube.npy')
Explanation: We load the results from the best parameter Chempy run:
End of explanation
print(sun_def_ab.dtype.names)
Explanation: These are the available elements (not all are trustworthy)
End of explanation
print(sun_def_cube['time'])
Explanation: These are the corresponding time-steps in Gyrs, 13.5 being present-day.
End of explanation
plt.plot(sun_def_ab['Fe'][1:],sun_def_ab['Mg'][1:]-sun_def_ab['Fe'][1:], label = 'single sun')
plt.plot(mult_sun_def_ab['Fe'][1:],mult_sun_def_ab['Mg'][1:]-mult_sun_def_ab['Fe'][1:], label = 'multi sun')
plt.plot(arc_def_ab['Fe'][1:],arc_def_ab['Mg'][1:]-arc_def_ab['Fe'][1:], label = 'single arc')
plt.plot(mult_arc_def_ab['Fe'][1:],mult_arc_def_ab['Mg'][1:]-mult_arc_def_ab['Fe'][1:], label = 'multi arc')
plt.plot(cas_def_ab['Fe'][1:],cas_def_ab['Mg'][1:]-cas_def_ab['Fe'][1:], label = 'single cas')
plt.plot(mult_cas_def_ab['Fe'][1:],mult_cas_def_ab['Mg'][1:]-mult_cas_def_ab['Fe'][1:], label = 'multi cas')
plt.plot(sun_alt_ab['Fe'][1:],sun_alt_ab['Mg'][1:]-sun_alt_ab['Fe'][1:],linestyle = '--', label = 'single sun alternative')
plt.plot(mult_sun_alt_ab['Fe'][1:],mult_sun_alt_ab['Mg'][1:]-mult_sun_alt_ab['Fe'][1:],linestyle = '--', label = 'multi sun alternative')
plt.plot(arc_alt_ab['Fe'][1:],arc_alt_ab['Mg'][1:]-arc_alt_ab['Fe'][1:],linestyle = '--', label = 'single arc alternative')
plt.plot(mult_arc_alt_ab['Fe'][1:],mult_arc_alt_ab['Mg'][1:]-mult_arc_alt_ab['Fe'][1:],linestyle = '--', label = 'multi arc alternative')
plt.plot(cas_alt_ab['Fe'][1:],cas_alt_ab['Mg'][1:]-cas_alt_ab['Fe'][1:],linestyle = '--', label = 'single cas alternative')
plt.plot(mult_cas_alt_ab['Fe'][1:],mult_cas_alt_ab['Mg'][1:]-mult_cas_alt_ab['Fe'][1:],linestyle = '--', label = 'multi cas alternative')
plt.xlabel('[Fe/H]')
plt.ylabel('[Mg/Fe]')
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.plot(sun_def_cube['time'][1:],sun_def_ab['Mg'][1:]-sun_def_ab['Fe'][1:])
plt.xlabel('time in Gyr')
plt.ylabel('[Mg/Fe]')
Explanation: Here is how you can plot them:
End of explanation
print(sun_def_cube.dtype.names)
Explanation: You can do this for all the available elements.
I would see the results for [Fe/H] < 1 as rough extrapolations.
Beware that you have to weight in the SFR and age-distribution of your tracer stars if you want to compare e.g. to metallicity distribution function. See https://github.com/jan-rybizki/Chempy/blob/master/tutorials/5-Chempy_function.ipynb the section called "A note on chemical evolution tracks and 'by eye' fit".
End of explanation
plt.plot(sun_def_cube['time'],sun_def_cube['sfr'], label = "SFR")
plt.plot(sun_def_cube['time'],sun_def_cube['infall'], label = "infall")
plt.plot(sun_def_cube['time'],sun_def_cube['stars'], label = "stars")
plt.plot(sun_def_cube['time'],sun_def_cube['gas'], label = "gas")
plt.plot(sun_def_cube['time'],sun_def_cube['sn1a'], label = "sn1a")
plt.plot(sun_def_cube['time'],sun_def_cube['sn2'], label = "sn2")
plt.plot(sun_def_cube['time'],sun_def_cube['mass_in_remnants'], label = "mass in remnants")
plt.yscale('log')
plt.legend()
Explanation: You can of course also compare to all other values saved in the cube e.g. SN rates or sfr/gas/stellar mass
End of explanation
<END_TASK>