Age/Metallicity Recovery Grids

Here we show recovered mass in the correct age bin and difference between input and recovered [Fe/H] as a function of input age, metallicity, filter, and distance.

In [6]:
import pandas as pd
import holoviews as hv
hv.notebook_extension('bokeh')
In [7]:
df = pd.read_csv('data/MIST_good_agebin.csv', usecols=list(range(5)) + [7])
# get rid of 'WFIRST_' from filter column
df['filt'] = df['filt'].str.split('_').str[-1]
df['feh_diff'] = df.feh_meas_mean - df.feh
df.head()
Out[7]:
filt dist age feh feh_meas_mean massdiff_mean feh_diff
0 X606 4.0 9.3 -2.2 -2.1987 0.96969 0.0013
1 X606 4.0 9.3 -1.8 -1.7987 0.98503 0.0013
2 X606 4.0 9.3 -1.3 -1.2970 0.96305 0.0030
3 X606 4.0 9.3 -0.8 -0.7982 0.93865 0.0018
4 X606 4.0 9.3 -0.5 -0.4988 0.91863 0.0012
In [8]:
# dimensions & labels
kdims = [('filt', 'Filter'), ('dist', 'Distance (Mpc)'),
         ('age', 'Input age (log yr)'),
         ('feh', 'Input [Fe/H]')]
vdims = [('feh_meas_mean', 'Measured [Fe/H]'),
         ('massdiff_mean', 'Fraction of mass in age bin'),
         ('feh_diff', 'Measured - input [Fe/H]')]
In [9]:
massfrac = hv.Table(df, kdims=kdims, vdims=vdims)
In [10]:
%opts Layout [show_title=False] \
HeatMap [width=300 height=450 invert_yaxis=False title_format='{label}' \
               colorbar=True colorbar_position='bottom' normalize=True] \
HeatMap.mass [colorbar_opts={'title':'Mass fraction at correct age'}] (cmap='inferno') \
HeatMap.feh [colorbar_opts={'title':'Measured - input [Fe/H]'}] (cmap='Spectral_r')

hm1 = massfrac.to.heatmap(kdims=['age','feh'], vdims=['massdiff_mean'],
                          group='mass', label='Mass at correct age')
hm2 = massfrac.to.heatmap(kdims=['age','feh'], vdims=['feh_diff'],
                          group='feh', label='Measured - input [Fe/H]')
hm1+hm2
Out[10]:
In [ ]: