In [1]:
%matplotlib inline
import read_mist_models
import numpy as np
import matplotlib.pyplot as plt

Working with ISO files

An .iso file is split into two types: basic and full. The basic .iso file contains 25 columns (e.g., initial mass, mass loss rate, effective temperature, surface H1 abundance) and the full .iso file contains 79 columns (e.g., log(L/Ledd) at the surface, surface C13 abundance, pp-burning luminosity, mass of the convective core) in addition to the 25 columns in the basic file type.

Read in the ISO file.

In [2]:
iso = read_mist_models.ISO('MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_basic.iso')
Reading in: MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_basic.iso

Check the available header information.

In [3]:
print 'version: ', iso.version
print 'abundances: ', iso.abun
print 'rotation: ', iso.rot
print 'ages: ', [round(x,2) for x in iso.ages]
print 'number of ages: ', iso.num_ages
print 'available columns: ', iso.hdr_list
version:  {'MESA': '7503', 'MIST': '1.0'}
abundances:  {'Zinit': 0.0142857, 'Yinit': 0.2703, '[Fe/H]': 0.0, '[a/Fe]': 0.0}
rotation:  0.4
ages:  [5.0, 5.05, 5.1, 5.15, 5.2, 5.25, 5.3, 5.35, 5.4, 5.45, 5.5, 5.55, 5.6, 5.65, 5.7, 5.75, 5.8, 5.85, 5.9, 5.95, 6.0, 6.05, 6.1, 6.15, 6.2, 6.25, 6.3, 6.35, 6.4, 6.45, 6.5, 6.55, 6.6, 6.65, 6.7, 6.75, 6.8, 6.85, 6.9, 6.95, 7.0, 7.05, 7.1, 7.15, 7.2, 7.25, 7.3, 7.35, 7.4, 7.45, 7.5, 7.55, 7.6, 7.65, 7.7, 7.75, 7.8, 7.85, 7.9, 7.95, 8.0, 8.05, 8.1, 8.15, 8.2, 8.25, 8.3, 8.35, 8.4, 8.45, 8.5, 8.55, 8.6, 8.65, 8.7, 8.75, 8.8, 8.85, 8.9, 8.95, 9.0, 9.05, 9.1, 9.15, 9.2, 9.25, 9.3, 9.35, 9.4, 9.45, 9.5, 9.55, 9.6, 9.65, 9.7, 9.75, 9.8, 9.85, 9.9, 9.95, 10.0, 10.05, 10.1, 10.15, 10.2, 10.25, 10.3]
number of ages:  107
available columns:  ['EEP', 'log10_isochrone_age_yr', 'initial_mass', 'star_mass', 'star_mdot', 'he_core_mass', 'c_core_mass', 'log_L', 'log_LH', 'log_LHe', 'log_Teff', 'log_R', 'log_g', 'surface_h1', 'surface_he3', 'surface_he4', 'surface_c12', 'surface_o16', 'log_center_T', 'log_center_Rho', 'center_gamma', 'center_h1', 'center_he4', 'center_c12', 'phase']

Plot an HD diagram at log(age) = 9.6.

In [4]:
age_ind = iso.age_index(9.6) #returns the index for the desired age
logTeff = iso.isos[age_ind]['log_Teff']
logL = iso.isos[age_ind]['log_L']
plt.plot(logTeff, logL) 
plt.xlabel('log(Teff)')
plt.ylabel('log(L)')
plt.axis([5.2, 3.3, -4, 5])
Out[4]:
[5.2, 3.3, -4, 5]

Working with ISO CMD files

An .iso.cmd file contains very basic "theory" columns such as the initial mass & effective temperature plus synthetic photometry.

Read in the CMD file.

In [5]:
isocmd = read_mist_models.ISOCMD('MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_SDSSugriz.iso.cmd')
Reading in: MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_SDSSugriz.iso.cmd

Check the available header information.

In [6]:
print 'version: ', isocmd.version
print 'photometric system: ', isocmd.photo_sys
print 'abundances: ', isocmd.abun
print 'rotation: ', isocmd.rot
print 'ages: ', [round(x,2) for x in isocmd.ages]
print 'number of ages: ', isocmd.num_ages
print 'available columns: ', isocmd.hdr_list
print 'Av extinction: ', isocmd.Av_extinction
version:  {'MESA': '7503', 'MIST': '1.0'}
photometric system:  UBV(RI)c + 2MASS + Kepler (Vega)
abundances:  {'Zinit': 0.0142857, 'Yinit': 0.2703, '[Fe/H]': 0.0, '[a/Fe]': 0.0}
rotation:  0.4
ages:  [5.0, 5.05, 5.1, 5.15, 5.2, 5.25, 5.3, 5.35, 5.4, 5.45, 5.5, 5.55, 5.6, 5.65, 5.7, 5.75, 5.8, 5.85, 5.9, 5.95, 6.0, 6.05, 6.1, 6.15, 6.2, 6.25, 6.3, 6.35, 6.4, 6.45, 6.5, 6.55, 6.6, 6.65, 6.7, 6.75, 6.8, 6.85, 6.9, 6.95, 7.0, 7.05, 7.1, 7.15, 7.2, 7.25, 7.3, 7.35, 7.4, 7.45, 7.5, 7.55, 7.6, 7.65, 7.7, 7.75, 7.8, 7.85, 7.9, 7.95, 8.0, 8.05, 8.1, 8.15, 8.2, 8.25, 8.3, 8.35, 8.4, 8.45, 8.5, 8.55, 8.6, 8.65, 8.7, 8.75, 8.8, 8.85, 8.9, 8.95, 9.0, 9.05, 9.1, 9.15, 9.2, 9.25, 9.3, 9.35, 9.4, 9.45, 9.5, 9.55, 9.6, 9.65, 9.7, 9.75, 9.8, 9.85, 9.9, 9.95, 10.0, 10.05, 10.1, 10.15, 10.2, 10.25, 10.3]
number of ages:  107
available columns:  ['EEP', 'log10_isochrone_age_yr', 'initial_mass', 'log_Teff', 'log_g', 'log_L', 'Z_surf', 'Bessell_U', 'Bessell_B', 'Bessell_V', 'Bessell_R', 'Bessell_I', '2MASS_J', '2MASS_H', '2MASS_Ks', 'Kepler_Kp', 'Kepler_D51', 'phase']
Av extinction:  0.0

Plot a CMD at log(age) = 9.6 in B & V bands.

In [7]:
age_ind = isocmd.age_index(9.6) #returns the index for the desired age
B = isocmd.isocmds[age_ind]['Bessell_B']
V = isocmd.isocmds[age_ind]['Bessell_V']
plt.plot(B-V, V) 
plt.xlabel('Bessell B - Bessell V')
plt.ylabel('Bessell V')
plt.axis([-0.5, 2.0, 18, -7])
Out[7]:
[-0.5, 2.0, 18, -7]

Working with EEP files

A .track.eep file contains the evolutionary history information of a star of a given initial mass.

Read in the EEP file.

In [8]:
eep = read_mist_models.EEP('00100M.track.eep')
Reading in: 00100M.track.eep

Check the available header information.

In [9]:
print 'version: ', eep.version
print 'abundances: ', eep.abun
print 'rotation: ', eep.rot
print 'initial mass: ', eep.minit
print 'available columns: ', eep.hdr_list
version:  {'MESA': '7503', 'MIST': '1.0'}
abundances:  {'Zinit': 0.0142857, 'Yinit': 0.2703, '[Fe/H]': 0.0, '[a/Fe]': 0.0}
rotation:  0.4
initial mass:  1.0
available columns:  ['star_age', 'star_mass', 'star_mdot', 'he_core_mass', 'c_core_mass', 'log_L', 'log_LH', 'log_LHe', 'log_Teff', 'log_R', 'log_g', 'surface_h1', 'surface_he3', 'surface_he4', 'surface_c12', 'surface_o16', 'log_center_T', 'log_center_Rho', 'center_gamma', 'center_h1', 'center_he4', 'center_c12', 'phase']

Plot the HR diagram and mark the main sequence and the white dwarf cooling sequence.

In [10]:
eep.plot_HR(color='Black', phases=[0, 6], phasecolor=['Red', 'Blue'])
# Following the FSPS notation, PMS:-1 ; MS:0 ; SGB+RGB:2 ; CHeB:3 ; EAGB:4 ; TPAGB:5 ; post-AGB:6 ; WR:9

Plot the central abundances as a function of time.

In [11]:
star_age = eep.eeps['star_age']
center_h1 = eep.eeps['center_h1']
center_he4 = eep.eeps['center_he4']
center_c12 = eep.eeps['center_c12']
plt.plot(star_age, center_h1, label='H1')
plt.plot(star_age, center_he4, label='He4')
plt.plot(star_age, center_c12, label='C12')
plt.xlabel('Star Age')
plt.ylabel('Mass Fraction')
plt.axis([1e7, 1.5e10, 1e-6, 3])
plt.xscale('log')
plt.yscale('log')
leg = plt.legend(loc=3, fontsize=16)
leg.draw_frame(False)

Working with EEP CMD files

A .track.eep.cmd file contains very basic "theory" columns such as the initial mass & effective temperature plus synthetic photometry to map out the evolutionary history of a star of a given initial mass.

Read in the EEP CMD file.

In [12]:
eepcmd = read_mist_models.EEPCMD('00100M.track.eep.cmd')
Reading in: 00100M.track.eep.cmd

Check the available header information.

In [13]:
print 'version: ', eepcmd.version
print 'photometric system: ', eepcmd.photo_sys
print 'abundances: ', eepcmd.abun
print 'rotation: ', eepcmd.rot
print 'initial mass: ', eepcmd.minit
print 'Av extinction: ', eepcmd.Av_extinction
print 'available columns: ', eepcmd.hdr_list
version:  {'MESA': '7503', 'MIST': '1.0'}
photometric system:  UBV(RI)c + 2MASS + Kepler (Vega)
abundances:  {'Zinit': 0.0142857, 'Yinit': 0.2703, '[Fe/H]': 0.0, '[a/Fe]': 0.0}
rotation:  0.4
initial mass:  1.0
Av extinction:  0.0
available columns:  ['star_age', 'log_Teff', 'log_g', 'log_L', 'Z_surf', 'Bessell_U', 'Bessell_B', 'Bessell_V', 'Bessell_R', 'Bessell_I', '2MASS_J', '2MASS_H', '2MASS_Ks', 'Kepler_Kp', 'Kepler_D51', 'phase']

Plot the HR diagram and mark the main sequence and the white dwarf cooling sequence.

In [14]:
eepcmd.plot_CMD(['Bessell_B', 'Bessell_V', 'Bessell_V'], color='Black', phases=[0, 6], phasecolor=['Red', 'Blue'])
# Following the FSPS notation, PMS:-1 ; MS:0 ; SGB+RGB:2 ; CHeB:3 ; EAGB:4 ; TPAGB:5 ; post-AGB:6 ; WR:9