Skip to content

Instantly share code, notes, and snippets.

@megbedell
Created December 21, 2018 15:18
Show Gist options
  • Save megbedell/a3f144463d16e88e8389f70b90bcb93b to your computer and use it in GitHub Desktop.
Save megbedell/a3f144463d16e88e8389f70b90bcb93b to your computer and use it in GitHub Desktop.
isochrone_fit
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
import isochrones
# In[2]:
from isochrones.mist import MIST_Isochrone
mist = MIST_Isochrone()
from isochrones import StarModel
# In[3]:
from isochrones.dartmouth import Dartmouth_Isochrone
dar = Dartmouth_Isochrone()
# In[5]:
mod = StarModel(dar,
#Kepler=(15.756, 0.05),
U=(17.363, 0.03),
B=(16.932, 0.027),
V=(16.097, 0.02),
J=(14.364, 0.03),
H=(13.989,0.041),
parallax=(0.40645, 0.0358),
#G=(15.7627, 0.0005),
#Bp=(16.240818, 0.02),
#Rp=(15.142935, 0.02),
maxAV=100. # get rid of default Av=1 max bound
)
# In[6]:
astrometric_chi2_al = 207.95844
astrometric_n_good_obs_al = 217
phot_g_mean_mag = 15.762711
if astrometric_chi2_al/(astrometric_n_good_obs_al-5) < 1.44*np.exp(-0.4*(phot_g_mean_mag-19.5)):
print("Gaia parallax is probably good.")
# In[7]:
from isochrones.priors import FlatPrior
av_prior = FlatPrior((0.,3.)) # broad prior
mod._priors['AV'] = av_prior
# In[8]:
mod.fit(basename='Kepler-1625', overwrite=True)
mod.corner_physical();
# In[9]:
print(mod.samples.mass_0_0.quantile([0.16, 0.5, 0.84]))
print(mod.samples.radius_0_0.quantile([0.16, 0.5, 0.84]))
# In[10]:
mod.corner_observed();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment