%matplotlib inline
import read_mist_models
import numpy as np
import matplotlib.pyplot as plt
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.
iso = read_mist_models.ISO('MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_basic.iso')
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
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])
isocmd = read_mist_models.ISOCMD('MIST_v1.0_feh_p0.00_afe_p0.0_vvcrit0.4_SDSSugriz.iso.cmd')
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
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])
eep = read_mist_models.EEP('00100M.track.eep')
print 'version: ', eep.version
print 'abundances: ', eep.abun
print 'rotation: ', eep.rot
print 'initial mass: ', eep.minit
print 'available columns: ', eep.hdr_list
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
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)
eepcmd = read_mist_models.EEPCMD('00100M.track.eep.cmd')
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
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