Prepared by Benoit Côté
The STELLAB module (which is a contraction for Stellar Abundances) enables to plot observational data for comparison with galactic chemical evolution (GCE) predictions. The abundance ratios are presented in the following spectroscopic notation :
The following sections describe how to use the code.
In [4]:
# Import the needed packages
%matplotlib nbagg
import matplotlib
import matplotlib.pyplot as plt
In [5]:
# Import the observational data module
from NuPyCEE import stellab
In order to plot observed stellar abundances, you just need to enter the wanted ratios with the xaxis and yaxis parameters. Stellab has been coded in a way that any abundance ratio can be plotted (see Appendix A below), as long as the considered data sets contain the elements. In this example, we consider the Milky Way.
In [6]:
# Create an instance of Stellab
s = stellab.stellab()
In [7]:
# Plot observational data (you can try all the ratios you want)
%matplotlib nbagg
s.plot_spectro(xaxis='[Fe/H]', yaxis='[Eu/Fe]')
plt.xlim(-4.5,0.75)
plt.ylim(-1.6,1.6)
Out[7]:
By default, the solar normalization $\log(n_A/n_B)_\odot$ is taken from the reference paper that provide the data set. But every data point can be re-normalized to any other solar values (see Appendix B), using the norm parameter. This is highly recommended, since the original data points may not have the same solar normalization.
In [8]:
# First, you can see the list of the available solar abundances
s.list_solar_norm()
Here is an example of how the observational data can be re-normalized.
In [9]:
# Plot using the default solar normalization of each data set
%matplotlib nbagg
s.plot_spectro(xaxis='[Fe/H]', yaxis='[Ca/Fe]')
plt.xlim(-4.5,0.75)
plt.ylim(-1.4,1.6)
Out[9]:
In [10]:
# Plot using the same solar normalization for all data sets
%matplotlib nbagg
s.plot_spectro(xaxis='[Fe/H]', yaxis='[Ca/Fe]', norm='Asplund_et_al_2009')
plt.xlim(-4.5,0.75)
plt.ylim(-1.4,1.6)
Out[10]:
You can select a subset of the observational data implemented in Stellab.
In [11]:
# First, you can see the list of the available reference papers
s.list_ref_papers()
In [12]:
# Create a list of reference papers
%matplotlib nbagg
obs = ['stellab_data/milky_way_data/Jacobson_et_al_2015_stellab',\
'stellab_data/milky_way_data/Venn_et_al_2004_stellab',\
'stellab_data/milky_way_data/Yong_et_al_2013_stellab',\
'stellab_data/milky_way_data/Bensby_et_al_2014_stellab']
# Plot data using your selection of data points
s.plot_spectro(xaxis='[Fe/H]', yaxis='[Ca/Fe]', norm='Asplund_et_al_2009', obs=obs)
plt.xlim(-4.5,0.7)
plt.ylim(-1.4,1.6)
Out[12]:
The Milky Way (milky_way) is the default galaxy. But you can select another galaxy among Sculptor, Fornax, and Carina (use lower case letters).
In [13]:
# Plot data using a specific galaxy
%matplotlib nbagg
s.plot_spectro(xaxis='[Fe/H]', yaxis='[Si/Fe]',norm='Asplund_et_al_2009', galaxy='fornax')
plt.xlim(-4.5,0.75)
plt.ylim(-1.4,1.4)
Out[13]:
It is possible to plot error bars with the show_err parameter, and print the mean errors with the show_mean_err parameter.
In [14]:
# Plot error bars for a specific galaxy
%matplotlib nbagg
s.plot_spectro(xaxis='[Fe/H]',yaxis='[Ti/Fe]',\
norm='Asplund_et_al_2009', galaxy='sculptor', show_err=True, show_mean_err=True)
plt.xlim(-4.5,0.75)
plt.ylim(-1.4,1.4)
Out[14]:
Let's consider that a data set provides stellar abundances in the form of [X/Y], where Y is the reference element (often H or Fe) and X represents any element. It is possible to change the reference element by using simple substractions and additions.
Let's say we want [Ca/Mg] from [Ca/Fe] and [Mg/Fe].
Let's say we want [Mg/H] from [Fe/H] and [Mg/Fe].
In [15]:
# Everything should be on a horizontal line
%matplotlib nbagg
s.plot_spectro(xaxis='[Mg/H]', yaxis='[Ti/Ti]')
plt.xlim(-1,1)
plt.ylim(-1,1)
Out[15]:
In [16]:
# Everything should be on a vertical line
%matplotlib nbagg
s.plot_spectro(xaxis='[Mg/Mg]', yaxis='[Ti/Mg]')
plt.xlim(-1,1)
plt.ylim(-1,1)
Out[16]:
In [17]:
# Everything should be at zero
%matplotlib nbagg
s.plot_spectro(xaxis='[Mg/Mg]', yaxis='[Ti/Ti]')
plt.xlim(-1,1)
plt.ylim(-1,1)
Out[17]:
Changing the solar normalization is a very straightforward operation.
In these two last equations, paper refers to the reference paper that provides the data set, and re-norm refers to the new solar abundances you want for your re-normalization.
In [ ]: