In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from isochrones.dartmouth import Dartmouth_Isochrone
from isochrones import StarModel
In [2]:
dar = Dartmouth_Isochrone()
In [3]:
mass,age,feh = (1,9.7,0.0)
dar(mass, age, feh, return_df=False) #return a dictionary instead of DataFrame
Out[3]:
In [4]:
ages = np.linspace(9,9.8,200)
radii1 = dar.radius(1,ages,0.0)
radii2 = dar.radius(1,ages,0.2)
radii3 = dar.radius(1,ages,-0.2)
plt.plot(ages,radii1,label='feh=0.0')
plt.plot(ages,radii2,label='feh=0.2')
plt.plot(ages,radii3,label='feh=-0.2')
plt.xlabel('log(age)')
plt.ylabel('radius')
plt.legend(loc='upper left');
In [5]:
ev = dar.evtrack(1.0,dage=0.01)
plt.plot((ev['Teff']),ev['logL'],'.')
plt.xlabel('Teff')
plt.ylabel('logL');
In [6]:
mod = StarModel(dar,Teff=(5770,80),logg=(4.44,0.10),feh=(0.0,0.1))
Find best point estimate for model:
In [7]:
mod.maxlike()
Out[7]:
Fit for uncertainties using MCMC:
In [8]:
mod.fit_mcmc()
Out[8]:
Let's take a look at some parameters:
In [9]:
mod.plot_samples('radius')
mod.plot_samples('age')
We can also look at triangle plots (if you have the triangle
package installed):
In [10]:
mod.triangle_plots()
Out[10]:
Kepler-93 (KOI-69) has published values: $M = 0.91 \pm 0.06$, $R = 0.92 \pm 0.02$, based on an asteroseismic $\log g$:
In [3]:
mags = {'H': (8.4459999999999997,0.08),
'J': (8.7710000000000008,0.08),
'K': (8.3699999999999992,0.08),
'g':(10.33,0.08),
'r':(9.83,0.08)}
specprops = dict(Teff=(5626,64),logg=(4.47,0.07),feh=(-.16,0.1))
In [4]:
smod_phot = StarModel(dar,**mags)
smod_phot.fit_mcmc()
Out[4]:
In [7]:
smod_phot.prop_triangle();
In [5]:
smod_phot.triangle(params=['mass','radius'], truths=[0.91,0.92]);
In [14]:
smod_spec = StarModel(dar,**specprops)
smod_spec.fit_mcmc()
Out[14]:
In [15]:
smod_spec.triangle(params=['mass','radius'], truths=[0.91,0.92]);
In [16]:
allprops = {'H': (8.4459999999999997,0.08),
'J': (8.7710000000000008,0.08),
'K': (8.3699999999999992,0.08),
'g':(10.33,0.08),
'r':(9.83,0.08),
'Teff':(5626,64),
'logg':(4.47,0.07),
'feh':(-0.16,0.1)}
smod_all = StarModel(dar,**allprops)
smod_all.fit_mcmc()
Out[16]:
In [17]:
smod_all.triangle(params=['mass','radius'], truths=[0.91,0.92]);
In [ ]: