Namaste 2 example

Here is a short readable (and copy-and-pastable) example as to how to use Namaste 2 to fit a single transit.


In [1]:
from namaste import *
import numpy as np

import matplotlib.pyplot as plt
%matplotlib inline

In [2]:
#%matplotlib inline
%reload_ext autoreload
%autoreload 2

Initialising the star


In [3]:
#Using 203311200 (from Osborn 2016) as a test case
st=namaste.Star('203311200',namaste.Settings(nsteps=1000,nthreads=4,mission='K2'))


2018-10-20 17:27:52,259 INFO 115:namaste.py(50345) - 203311200 - initialising Star object

In [4]:
#Can add data directly here:
st.addRad(2.024,0.176)#solar
st.addMass(1.33,0.35)#solar 
st.addTeff(6088,250)#K

#Caculates density:
st.addDens()


[1.88537258 2.11493695 2.11214524 ... 2.02421088 2.28108478 1.97840447]

In [9]:
#Or you can use a csv file, for example:
st.csvfile_dat('ExampleData/EPIC203311200_beststelpars.csv')
#st.addLightcurve('/Volumes/CHEOPS/K2_MONOS/BestLCs/EPIC203311200_bestlc_ev.npy')


2018-10-19 16:57:02,989 INFO 149:namaste.py(48978) - 203311200 - Getting information from csv
/Users/hosborn/Postdoc/K2/Namaste_2/namaste/namaste.py:151: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls
  df=pd.DataFrame.from_csv(file)

In [5]:
#Saving the star
st.SaveAll(overwrite=True)

In [7]:
#We need to use Teff and Logg information to initialise Limb Darkening (default: Kepler)
st.initLD()

To change settings use the st.settings approach


In [8]:
st.settings.printall()


{'GP': True, 'nopt': 25, 'nsteps': 12500, 'npdf': 6000, 'nwalkers': 24, 'nthreads': 8, 'ndurswindow': 6, 'anomcut': 3.75, 'fitsloc': './FitsFiles/', 'outfilesloc': './Outputs/', 'cadence': 0.0204318, 'kernel': 'quasi', 'verbose': True, 'mission': 'K2', 'fit_tdur': False, 'fit_vel': True}

In [9]:
#eg change number of steps in mcmc:
st.settings.update(nsteps=8000)
#or the "sigma" at which to cut anomalies:
st.settings.update(anomcut=4.5)
#Not doing a GP!
st.settings.update(GP=True)
st.settings.update(kernel='Real')

Adding a lightcurve:


In [10]:
st.addLightcurve('ExampleData/EPIC203311200_bestlc_ev.npy')


(3515, 3)
/Users/hosborn/Postdoc/K2/Namaste_2/namaste/namaste.py:1279: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls
  kicdat=pd.DataFrame.from_csv("https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=k2targets&where=epic_number=%27"+str(int(kic))+"%27")
Out[10]:
<namaste.namaste.Lightcurve at 0x1144d2470>

In [11]:
plt.plot(st.Lcurve.lc[:,0],st.Lcurve.lc[:,1],'.')
plt.plot(st.Lcurve.lc[st.Lcurve.lcmask,0],st.Lcurve.lc[st.Lcurve.lcmask,1],',')


Out[11]:
[<matplotlib.lines.Line2D at 0x114a3a6d8>]

Initialising the GP:

This uses Celerite. For the moment, only the quasi-periodic stellar rotation kernel is working, but I hope to update this to include "no GP" and "ExpSq" in the future.


In [12]:
# Can set 'kernel' in settings as "quasi" or "Real"
st.settings.update(kernel='Real')
st.addGP()

#This then optimizes the hyperparameters using the lightcurve (and the out-of-transit regions, if a transit has been specified)
st.Optimize_GP()


2018-10-20 17:28:45,468 INFO 273:namaste.py(50345) - 203311200 - Adding GP
2018-10-20 17:28:45,470 INFO 317:namaste.py(50345) - 203311200 - optimizing GP
2018-10-20 17:28:45,472 DEBUG 324:namaste.py(50345) - 203311200 -  nans in y: 0
2018-10-20 17:28:45,473 INFO 273:namaste.py(50345) - 203311200 - Adding GP
2018-10-20 17:28:45,476 DEBUG 336:namaste.py(50345) - 203311200 - vect: -11.336742338080384,-1.0986122886681098,-9.820292730981462,1.0
2018-10-20 17:28:45,477 DEBUG 337:namaste.py(50345) - 203311200 - bounds: (-20 | 0.0) , (-3 | 4.5) , (-10.070292730981462 | -9.570292730981462) , (None | None)
2018-10-20 17:28:45,479 DEBUG 338:namaste.py(50345) - 203311200 - nll: -23926.522504281405
2018-10-20 17:28:46,149 DEBUG 342:namaste.py(50345) - 203311200 - init GP lpp is -27164.518253648836 using -11.173711928073937 , -4.628798986109649 , -11.002086462337118 , 1.0002511281605315
[-11.11445156  -3.94367426  -9.82029273   1.        ]
[-10.12768949  -4.39531862  -9.82029273   1.        ]
[-10.86746422  -3.532824    -9.82029273   1.        ]
[-20.9264629   -4.62603646  -9.82029273   1.        ]
[-12.62252576  -7.35650158  -9.82029273   1.        ]
[-12.87561966  -6.27727439  -9.82029273   1.        ]
[-9.75885248 -8.28508575 -9.82029273  1.        ]
[-12.16161999  -5.8645028   -9.82029273   1.        ]
[-9.76573952 -4.08735301 -9.82029273  1.        ]
[-19.50983541  -1.53260342  -9.82029273   1.        ]
[-11.8709396   -5.78398954  -9.82029273   1.        ]
[-14.27466781  -6.17675079  -9.82029273   1.        ]
[-10.03674038  -7.53929516  -9.82029273   1.        ]
[-14.17585205  -1.48706484  -9.82029273   1.        ]
[-13.61488336  -4.01754256  -9.82029273   1.        ]
[-11.24218682  -1.3932127   -9.82029273   1.        ]
[-8.97247254 -5.60273944 -9.82029273  1.        ]
[-8.8919306  -6.18234115 -9.82029273  1.        ]
[-18.36649055  -5.97122629  -9.82029273   1.        ]
[-9.04781977 -2.65517805 -9.82029273  1.        ]
[-10.95534045  -7.49381672  -9.82029273   1.        ]
[-7.2525664  -5.44128097 -9.82029273  1.        ]
[-7.34871994 -5.39924051 -9.82029273  1.        ]
[ -3.7609598  -11.1657877   -9.82029273   1.        ]
[-13.77560868  -2.26166918  -9.82029273   1.        ]
[[ 0.00000000e+00  0.00000000e+00  0.00000000e+00  0.00000000e+00
   0.00000000e+00]
 [-1.15146140e+01 -4.36112177e+00 -1.07717316e+01  1.00070025e+00
  -2.71655393e+04]
 [-1.08140101e+01 -5.06192026e+00 -1.07728235e+01  1.00076967e+00
  -2.71656315e+04]
 [-1.10423949e+01 -4.83395855e+00 -1.07690952e+01  1.00077238e+00
  -2.71656484e+04]
 [-1.10365846e+01 -4.76600963e+00 -1.84788675e+01  1.00075932e+00
  -2.71627348e+04]
 [-1.04833696e+01 -5.39261691e+00 -1.07715177e+01  1.00081486e+00
  -2.71655619e+04]
 [-1.11634499e+01 -4.71329258e+00 -1.07666562e+01  1.00075041e+00
  -2.71656423e+04]
 [-1.10355595e+01 -4.84013640e+00 -1.07709885e+01  1.00077339e+00
  -2.71656483e+04]
 [-1.10774134e+01 -4.79873391e+00 -1.07696591e+01  1.00076561e+00
  -2.71656479e+04]
 [-1.07776033e+01 -5.09931670e+00 -1.07644663e+01  1.00078660e+00
  -2.71656259e+04]
 [-1.10282715e+01 -4.84810131e+00 -1.07684454e+01  1.00076847e+00
  -2.71656483e+04]
 [-1.09767479e+01 -4.89949553e+00 -1.07696195e+01  1.00078107e+00
  -2.71656469e+04]
 [-1.10391020e+01 -4.83690108e+00 -1.07696165e+01  1.00078107e+00
  -2.71656483e+04]
 [-1.10375127e+01 -4.83876082e+00 -1.07692798e+01  1.00077275e+00
  -2.71656484e+04]
 [-1.10545318e+01 -4.74799978e+00 -1.52754062e+01  1.00076201e+00
  -2.71627355e+04]
 [-1.10431353e+01 -4.83328387e+00 -1.07689340e+01  1.00076146e+00
  -2.71656483e+04]
 [-1.10566276e+01 -4.81939454e+00 -1.07692778e+01  1.00077687e+00
  -2.71656482e+04]
 [-1.10440698e+01 -4.83167640e+00 -1.07694446e+01  1.00076540e+00
  -2.71656483e+04]
 [-9.29691210e+00 -6.58020217e+00 -1.07671511e+01  1.00086062e+00
  -2.71651093e+04]
 [-1.10434368e+01 -4.75904281e+00 -2.22434615e+01  1.00074749e+00
  -2.71627348e+04]
 [-1.11924419e+01 -4.68373403e+00 -1.07688644e+01  1.00075525e+00
  -2.71656392e+04]
 [-1.10432982e+01 -4.83296924e+00 -1.07694616e+01  1.00077621e+00
  -2.71656484e+04]
 [-1.10472175e+01 -4.82893356e+00 -1.07699399e+01  1.00077781e+00
  -2.71656483e+04]
 [-1.10419614e+01 -4.83429076e+00 -1.07690379e+01  1.00076999e+00
  -2.71656484e+04]
 [-4.20606432e+00 -1.16693156e+01 -1.07565761e+01  1.00082008e+00
  -2.71626094e+04]
 [-1.10511762e+01 -4.75146919e+00 -2.02451188e+01  1.00082232e+00
  -2.71627346e+04]]
0 failed attempts out of 25
white noise changed by a factor of 0.38
GP improved from  -27164.518253648836  to  -27165.648353641456

Adding and initialising the Monotransit

So we have set up our star, importantly with the density included. Now we must add a monotransit. This is set up such that multiple monotransits can be added (although I have yet to check this feature).

The format is $t_{\rm cen}$, $b$, and $R_p/R_s$


In [13]:
#Adds this to mono1
st.AddMonotransit(2121.02,0.5,0.0032,name='mono1')


monopriors: {'mean:tcen': [2120.87, 2121.17], 'mean:b': [0.0, 1.25], 'mean:vel': [0, 4.621799277795926, 'normlim', 2.735973080443852, 0.3771652394704148], 'mean:RpRs': [0.02, 0.25], 'mean:LD1': [0, 1.0, 'gaussian', 0.3391817964001663, 0.036441495445950725], 'mean:LD2': [0, 1.0, 'gaussian', 0.2932210147044807, 0.01997738037265819]}
nll init 2279.474178305063
Best_Result: [2.12102399e+03 7.89724378e-01 2.60265457e+00 5.85060816e-02
 1.29489612e-01 2.93258908e-01 1.10934273e+03]
initial fit nll:  2279.474178305063  to new fit nll:  1109.342726123128

In [14]:
#Accessing pure transit fit:

st.BuildMeanModel()
model=st.meanmodel_comb.get_value(np.arange(2120.6,2121.4,0.005))
plt.plot(st.Lcurve.lc[abs(st.Lcurve.lc[:,0]-st.mono1.tcen)<1.5,0],st.Lcurve.lc[abs(st.Lcurve.lc[:,0]-st.mono1.tcen)<1.5,1],'.')
plt.plot(np.arange(2120.6,2121.4,0.005),model,'--')


Out[14]:
[<matplotlib.lines.Line2D at 0x114bb6da0>]

Running a model MCMC


In [18]:
#Now we have our mean-functions (eg transit models) added, we need to build the priors and the model:
st.BuildMeanPriors()
st.BuildMeanModel()

In [15]:
# Then we need the combine the kernel we've optimised with the monotransit mean model into a Celerite GP:
import celerite

st.gp=celerite.GP(kernel=st.kern,mean=st.meanmodel_comb,fit_mean=True)

In [16]:
# Now we need to build all the priors (not just the mean functions)

st.BuildAllPriors(st.gp.get_parameter_names())


{'kernel:terms[0]:log_a': [-20, 0.0], 'kernel:terms[0]:log_c': [-3, 4.5], 'mean:tcen': [2120.87, 2121.17], 'mean:b': [0.0, 1.25], 'mean:vel': [0, 4.621799277795926, 'normlim', 2.735973080443852, 0.3771652394704148], 'mean:RpRs': [0.02, 0.25], 'mean:LD1': [0, 1.0, 'gaussian', 0.3391817964001663, 0.036441495445950725], 'mean:LD2': [0, 1.0, 'gaussian', 0.2932210147044807, 0.01997738037265819]}

In [17]:
# Making walkers initial positions
chx=np.random.choice(st.settings.npdf,st.settings.nwalkers,replace=False)

#Tidying up so that the Celerite priors match our prior names
st.fitdict.update({'mean:'+nm:getattr(st.mono1,nm+'s')[chx] for nm in ['tcen','b','vel','RpRs']})
st.fitdict.update({'mean:'+nm:getattr(st,nm+'s')[chx] for nm in ['LD1','LD2']})

In [18]:
#Removing medians:
for row in st.fitdict:
    st.fitdict[row][np.isnan(st.fitdict[row])]=np.nanmedian(np.isnan(st.fitdict[row]))
dists=[st.fitdict[cname] for cname in st.gp.get_parameter_names()]
st.init_mcmc_params=np.column_stack(dists)

In [19]:
#Masking an arbitrary region around the transit for analysis (2.75d in this case)
mask=abs(st.Lcurve.lc[:,0]-st.gp.get_parameter('mean:tcen'))<2.75

In [21]:
# Doing an initial fit with PlotModel:

_=namaste.PlotModel(st.Lcurve.lc[mask,:], st.gp, np.median(st.init_mcmc_params,axis=0), fname=st.settings.outfilesloc+st.objname+'_initfit.png',GP=True)



In [34]:
#RUNNING THE MCMC WITH EMCEE:
import emcee
st.sampler = emcee.EnsembleSampler(st.settings.nwalkers, len(st.gp.get_parameter_vector()), namaste.MonoLogProb, args=(st.Lcurve.lc,st.priors,st.gp), threads=st.settings.nthreads)

If in the following line you see:

PicklingError: Can't pickle <class 'namaste.namaste.MonotransitModel'>: it's not the same object as namaste.namaste.MonotransitModel

then try re-running this script!


In [35]:
#Just checking if the MCMC works/progresses:

st.sampler.run_mcmc(st.init_mcmc_params, 1, rstate0=np.random.get_state())


Out[35]:
(array([[-1.00343710e+01, -5.59649329e+00,  2.12103433e+03,
          9.01510904e-01,  3.73677986e+00,  4.90668921e-02,
          3.73296083e-01,  2.74188650e-01],
        [-1.13626819e+01, -3.74921595e+00,  2.12104936e+03,
          5.59134688e-01,  5.39631658e+00,  4.66400026e-02,
          3.54444921e-01,  2.85483012e-01],
        [-8.62521131e+00, -3.66315291e+00,  2.12102122e+03,
          5.07979389e-01,  4.15892124e+00,  9.93201816e-02,
          3.74305562e-01,  2.73344587e-01],
        [-9.44886658e+00, -1.60002741e+00,  2.12102781e+03,
          5.75450164e-01,  3.41553187e+00,  5.48576776e-02,
          3.21206546e-01,  3.02488378e-01],
        [-8.53633265e+00, -4.04921792e+00,  2.12102748e+03,
          5.35511735e-01,  1.89692734e+00,  2.67777656e-02,
          3.03403608e-01,  3.12064208e-01],
        [-1.30084939e+01, -4.61881628e+00,  2.12103492e+03,
          4.81436882e-01,  3.64987024e+00,  5.75237592e-02,
          3.35444394e-01,  2.95041615e-01],
        [-1.10939783e+01, -4.55082269e+00,  2.12105406e+03,
          5.40412668e-01,  3.59511799e+00,  2.36594962e-02,
          3.15152291e-01,  3.05247903e-01],
        [-1.17277033e+01, -7.26971583e+00,  2.12097188e+03,
          1.37179022e-01,  3.99331214e+00,  4.29865742e-02,
          3.48598718e-01,  2.88440160e-01],
        [-9.20898626e+00, -5.63844239e+00,  2.12097961e+03,
          3.75639372e-01,  4.45545795e+00,  2.92744882e-02,
          2.87243325e-01,  3.19851910e-01],
        [-1.07731455e+01, -5.50771901e+00,  2.12102531e+03,
          2.44716854e-01,  2.87009800e+00,  4.76660647e-02,
          3.42462380e-01,  2.90511487e-01],
        [-1.10346112e+01, -2.08562504e+00,  2.12098761e+03,
          1.03595167e-01,  0.00000000e+00,  1.10056407e-01,
          4.00050384e-01,  2.57649589e-01],
        [-1.12238189e+01, -5.40618097e+00,  2.12107897e+03,
          5.67707446e-01,  4.76015132e+00,  6.84803716e-02,
          3.21710130e-01,  3.01726533e-01],
        [-1.01948883e+01, -5.15646895e+00,  2.12100345e+03,
          5.41778680e-01,  2.74730830e+00,  8.15808722e-02,
          3.73029038e-01,  2.73156155e-01],
        [-1.06161078e+01, -1.44018818e+00,  2.12103782e+03,
          1.38873067e+00,  4.13997367e+00,  5.77493603e-02,
          3.05819466e-01,  3.09851865e-01],
        [-1.06203050e+01, -2.26808250e+00,  2.12102233e+03,
          6.34553293e-01,  4.08974741e+00,  1.70169773e-02,
          3.49258796e-01,  2.87817764e-01],
        [-7.30058821e+00, -4.19798439e+00,  2.12096749e+03,
          4.94209729e-01,  4.32840634e+00,  2.13766548e-02,
          3.08443167e-01,  3.07514559e-01],
        [-1.26620557e+01, -6.32516776e+00,  2.12100489e+03,
          2.52660415e-01,  3.68709015e+00,  5.66797076e-02,
          3.74419477e-01,  2.73134734e-01],
        [-1.02902297e+01, -4.58709920e+00,  2.12098311e+03,
          2.09513843e-01,  3.56533782e+00,  6.76970703e-02,
          2.95601207e-01,  3.15101865e-01],
        [-1.12834056e+01, -6.87948210e+00,  2.12105829e+03,
          5.15846024e-01,  3.55365357e+00,  5.09461088e-02,
          3.45838077e-01,  2.89503355e-01],
        [-9.96808027e+00, -4.53970969e+00,  2.12102838e+03,
          1.52719634e+00,  5.00489421e+00,  8.23919772e-02,
          3.25504877e-01,  2.99577956e-01],
        [-1.08779547e+01, -5.57871880e+00,  2.12103971e+03,
          4.93764550e-01,  3.79777272e+00,  8.42604880e-02,
          3.16561744e-01,  3.04046584e-01],
        [-1.09138109e+01, -4.97162231e+00,  2.12099444e+03,
          7.10801577e-01,  2.93257316e+00,  5.78050182e-02,
          3.34687779e-01,  2.95154622e-01],
        [-1.15808106e+01, -5.57150465e+00,  2.12099875e+03,
          4.13464861e-01,  0.00000000e+00,  4.56294206e-02,
          3.99528249e-01,  2.58174090e-01],
        [-1.09423813e+01, -2.89612507e+00,  2.12102411e+03,
          8.17304256e-01,  3.88110629e+00,  5.16830722e-02,
          3.58065376e-01,  2.81807362e-01]]),
 array([-7.16052926e+19, -8.05536516e+19, -3.46238552e+19,  2.17085267e+04,
        -4.09466535e+19, -5.12430012e+19, -4.99532821e+19, -1.14339275e+20,
        -7.25550155e+19, -6.96160840e+19,  2.49626770e+04, -9.54583007e+19,
        -6.20202231e+19, -3.73302104e+19, -2.63137876e+19, -4.35245325e+19,
        -8.89919979e+19, -5.06393385e+19, -1.03482662e+20, -1.35813302e+20,
        -7.12047675e+19, -5.81990433e+19, -7.10425264e+19,  2.59258355e+04]),
 ('MT19937', array([1371518255, 2358292075, 2058673272, 1924812339,   80521641,
          859775344, 2784135915, 2128092412, 1276532972, 4232253944,
         1896065868,  956749519, 3879564961, 2336450801, 3548249446,
         2376934265, 2584770731, 4285131766, 2858217972,  193503874,
         3562160731, 1923767108, 1444199797, 4284964619,  658614566,
         3328439196, 3206581823, 1838453862, 1636629393, 2024514738,
         3505412738, 1379627660, 3758107934, 2250556879, 1147793678,
         1062795973, 2218074279, 1468331839, 2069469650,  718324187,
         1521609684, 2240090804, 4090678957,  130533369, 1151293995,
         2446089746,  925936961, 2639126754, 1979169078, 1157831664,
         3757228602, 1026836030, 3593908982, 3146931743,  590316371,
          905337891, 3589133973, 3306360150, 3019619415,  551497435,
         2087852632, 3927001094, 3591211333, 1057624986, 1514039477,
         3913088090, 3765570365,  138243957, 3840285805, 4159540535,
         3333938713, 3400326353,  447008480, 2666020374, 1590871858,
         2081419387, 4227030022,   36286029, 3916134178,  222856768,
          334458006, 2260554123, 2637698597, 2327136205, 2435205086,
         1415471395, 3627735019, 3269620804,  884461382, 2757954117,
         2244826944, 1896200506,  164799264, 4279991898, 2213414481,
         2891435594, 3516631454, 2637820855, 4059964200, 1955722118,
         2366960522, 3392621129,  414998959, 3371120531,  406059589,
         3796942366, 4213759368,  742373903, 3174215026, 2166312225,
          988848144, 3843345131,  130628146, 1608631346,  250383590,
           91003734, 2325798277, 1546282653, 2890014413, 3182548817,
         2048651513, 1009656948,   59738613, 3842736269,  307879845,
          711396968, 2669605781, 2672420360, 3044858790, 2096457874,
         4109731869, 3453697731,  977956662, 1681579461, 1733608549,
         2070717755,  199091307, 3944950652, 1667656842, 1043217192,
           80238529,  434726003, 1349796568, 1463799115, 1682284430,
         2907316331,  395133861, 1492665245, 4115034044, 3983467078,
         3239306437, 1855197324, 2502260910, 3384456171,  943602002,
         1976172955, 1859669682, 3532845556, 1946789103, 1973166454,
         1474368950, 4230108969, 2263725817, 1082543769, 3358228371,
          959534362, 2743209458, 2660651475,  144772132, 2359123826,
         1888070017,  179048745, 3325702752, 3843854168, 1439027249,
         3971188671, 2425859671, 1192897499,  618356399, 1736014009,
         2536448625, 4077147310, 1536168805, 4051722504, 3982664273,
          316608591, 3836726217, 2177750257,  915652001,  850536257,
         1640410362, 1481700957,  789461762, 3685222526, 3209589541,
         3862268647, 3778419888, 3744996247, 1152479686, 1077877555,
         3822216403, 4160935285,  611591165, 2605283543, 2346806321,
         2725712248, 2755514839, 3510208343,  617915045, 3583576023,
         1398603435, 4064449747,  852750676, 2048883917, 3495795466,
         1027637742, 2475830632, 3599211024, 1404241017,  156435210,
         3592102928,   92780336, 1801806897, 3209646584, 1730979592,
          180562495,  135231197, 2124542346, 4107532727,  119908914,
          683554115, 4232908305,  239671193, 2694031781, 1610719562,
          103369147, 2506724214, 4251598454, 3511484300, 3866472181,
          297345007, 3223225942,  884365294, 3813544565, 2551730443,
          109012696,  940720067, 3693551079, 3629409376,  788197951,
         3866201634, 1619822989, 2586631162,  589300747, 1524988820,
          286698443, 2720445142,  670653339, 2549507929,   50594408,
         2124099723, 2443040471, 3151220565, 2046112402, 2270917686,
          632584693, 2054579628, 1691582548, 3650006681, 2117975797,
         3385127586, 1030063726, 3063927829,  922236138, 2347777658,
         2931020170, 4029501487, 3120318211, 2371700820,  604633669,
         1198752341, 2134843027, 3427143909, 3765117551,  276936258,
         2429525130, 1766721705, 2171840265, 3260018628,  650777219,
         1472875657, 2007747012,  986767877, 4107779266, 2602305417,
         3514363637,  713238836, 3479990238,  464872828, 2319103870,
         1311826432, 2613954463,  230102538, 1742891738, 1197330262,
          925242065, 3886756454, 1611972922, 4022866975, 1844583074,
         2564640435, 3708675865,  678493816, 2873788914, 3170203953,
         2148141783, 2386185456, 1052486787, 2146768928,  423166613,
          905589946, 1210856989, 4280361614, 4229229352, 1666262411,
         2649534263, 3866240656, 1667880532, 2701605567,  843366853,
          932756674, 1940848065, 2560740221, 3190944162,  741103008,
         3065752803,  243260623, 3236690586, 2756044485, 3589117290,
         2324125313, 3550383608, 3195734738,  159306189, 1605048838,
         2508517126, 3529466203, 2122386113, 3488078278, 4028426659,
          655445733, 1220787711, 2669545906, 4113330658, 2010804647,
             825177, 1697532601, 2951801884, 3096583330, 1472071489,
          513123428, 2578729873, 2358035510, 1604134778, 3167773198,
         3550118608,  574982903, 3273223329,  323380358, 1020191110,
         2801123580, 2961817728, 2377949150, 3610457247, 2863941301,
         4154451183, 1417511728, 3521402645,  535664065,  147215909,
         2012159304, 2388402579, 3711581240,  891901037, 2967241240,
          380178996, 3688372501, 2457256391, 1080703507, 3342005809,
         2836905111, 1771550339, 3620556012, 2893220529, 1916941479,
         1040774325,  851845379, 3248034066, 1928485953, 3938864041,
          877061543, 2670655136, 3706527660, 2847646434,  847223865,
          186557160, 1453214979, 3347329377, 1529514094,  430509682,
         1236071254, 3911124013, 2621829498, 1716782395, 3258549061,
           59619924, 2981340542,  923196109, 1604935957,  476967474,
         4007898712,  100403188, 3682887570, 1865009019, 3570979089,
         1540225439,  936852084, 3235673868, 3233474627,  857251550,
         3549920946,  319749122,  586717109, 1895788853, 3326671256,
         4269624617, 3153886832, 2401465658, 3303510724, 1950315903,
          670671615, 3319221111,  734193868, 3377991550, 2153404542,
         4180424341,  203365744,  964408941, 4101567730, 3473900807,
         4089270937, 2860766342, 1569121647,  291253270, 3034867946,
         2482084411, 2467717714, 2653939712,  414271372, 2973944788,
         3054147912, 2853014623, 2022960491, 4225075833, 4071161301,
         2343217793, 3711776563,  891455013, 1029832733, 2006497521,
         4278167196, 1023967082, 1799474734, 1647717346, 3028497862,
          672519028, 3731458884, 2813838144, 3577749362, 3348757451,
         3182192215,  623139957,   20037511, 3418076279,  402490308,
         1591729455, 1879244293, 1676117359, 2503482881, 3554838848,
         3606631011,  504795367,  656685016, 1696376208,   60542097,
         4160237897, 3311386200, 1174931215, 1375720959,   80932268,
         3716244825,  353169167,  686915635,  156220294, 3765965132,
         1004803636, 1429272165, 3411162645, 1162975280, 1452028330,
          714552084, 3785714900, 1078388922,  764165076,  624784638,
          574992383, 1006344658,  693571523, 4262774027, 1409708789,
         3369721633,   35107859, 2624290318, 1051982986,  842305536,
         3687544217, 1521380838, 3598685321, 3767124780,  683497836,
         3140609419, 2621530736, 2355265218, 4279843171,  376886956,
          686856626, 2358337676, 1871846726, 2047999271,  862467316,
         3435057805, 2632016631, 1238187112, 1523449211, 3134120932,
         1173274597, 3256693288, 1681297663, 3567580353, 2362706528,
          861885907,  736789747, 2849961927,  597065319, 3186199350,
         2296392516, 1261830629, 2744968029,  971489635, 1783797161,
         3514479102,  322130366, 3476287996, 1684008970, 1864341766,
           80037424, 1394193318, 2300808910, 2191603554, 4034067190,
          135469197,   86770796,  917751390, 3328473580, 1180601883,
         1271694622,  289327302, 3556030909, 1957432939, 3986702439,
          996360054, 1354894709, 2948206113,  377633551, 4115290126,
           16994266, 1458507188, 1764005722, 2132203966, 2197617191,
          593207265, 1649216087, 3715320967,  607608974, 3399012667,
         2550335866,   39103979, 2646649146, 4290732037, 3438711637,
         2137757848, 3032970659, 3274023612, 2367909087, 3359239117,
         2642278805,  245870445, 3970326254, 2722330415, 3183971338,
         3446305486, 3958681226, 2995302593, 2765679619, 1956605547,
         2691206612, 3705870250,  840448567, 4190945552, 4045145799,
         1540145570, 3287261110, 4129015293, 3272690507], dtype=uint32), 325, 0, 0.0))

Running the MCMC


In [36]:
_ = st.sampler.run_mcmc(st.init_mcmc_params, int(st.settings.nsteps/12), rstate0=np.random.get_state())


Out[36]:
(array([[-1.41226032e+01, -2.99249438e+00,  2.12102664e+03,
          7.58491655e-01,  2.72051505e+00,  5.84423627e-02,
          3.47744544e-01,  2.86784548e-01],
        [-1.41985309e+01, -2.97494523e+00,  2.12102365e+03,
          7.41743501e-01,  2.81300141e+00,  5.89503183e-02,
          3.32180661e-01,  2.94175259e-01],
        [-1.40367639e+01, -2.95412000e+00,  2.12102517e+03,
          7.26552865e-01,  2.87242044e+00,  5.85162963e-02,
          3.28819305e-01,  2.98609651e-01],
        [-1.40900038e+01, -2.95438976e+00,  2.12102293e+03,
          7.25228000e-01,  2.89141929e+00,  5.76968560e-02,
          3.32506662e-01,  2.93922020e-01],
        [-1.36094765e+01, -2.34721664e+00,  2.12099806e+03,
          6.20346652e-01,  1.16350121e+00,  2.21774451e-02,
          3.89531326e-01,  2.63483609e-01],
        [-1.41793922e+01, -2.94067657e+00,  2.12102391e+03,
          7.62942212e-01,  2.71594440e+00,  5.96248570e-02,
          3.47904994e-01,  2.85282879e-01],
        [-1.41803941e+01, -2.99980421e+00,  2.12102344e+03,
          7.43604328e-01,  2.80497765e+00,  5.91861455e-02,
          3.31802099e-01,  2.95118245e-01],
        [-1.42024412e+01, -2.99367685e+00,  2.12102529e+03,
          7.68122863e-01,  2.66970678e+00,  5.93521586e-02,
          3.39102373e-01,  2.92000370e-01],
        [-1.23673140e+01, -2.81727689e+00,  2.12092294e+03,
          4.10420042e-02,  4.88805175e-02,  1.23492215e-01,
          4.08753115e-01,  2.49490515e-01],
        [-1.34856082e+01, -2.34243961e+00,  2.12103082e+03,
          4.54127354e-01,  9.38054415e-01,  4.01785456e-02,
          3.84416126e-01,  2.66595242e-01],
        [-1.40531336e+01, -2.95619453e+00,  2.12102174e+03,
          7.50762064e-01,  2.75322540e+00,  5.89193053e-02,
          3.29611214e-01,  2.96322317e-01],
        [-1.40622355e+01, -2.99260255e+00,  2.12102415e+03,
          7.68404774e-01,  2.67651612e+00,  6.03607636e-02,
          3.33422622e-01,  2.94424980e-01],
        [-1.41397591e+01, -2.99759000e+00,  2.12102366e+03,
          7.59728679e-01,  2.74267066e+00,  5.80567558e-02,
          3.30531583e-01,  2.95464173e-01],
        [-1.42488466e+01, -2.94974555e+00,  2.12102533e+03,
          7.54664784e-01,  2.73395822e+00,  5.92250412e-02,
          3.41636927e-01,  2.90142590e-01],
        [-1.40341213e+01, -2.99547828e+00,  2.12102291e+03,
          7.45383032e-01,  2.78887647e+00,  5.78601237e-02,
          3.33060785e-01,  2.93849734e-01],
        [-1.42637313e+01, -2.97608396e+00,  2.12102186e+03,
          7.68434448e-01,  2.65946788e+00,  5.89244321e-02,
          3.37736626e-01,  2.93819984e-01],
        [-1.41086974e+01, -2.96605443e+00,  2.12102337e+03,
          7.57827786e-01,  2.72317230e+00,  6.00048055e-02,
          3.21546245e-01,  3.00948266e-01],
        [-1.42611180e+01, -2.96688806e+00,  2.12102345e+03,
          7.73218079e-01,  2.65975641e+00,  5.90497791e-02,
          3.28356467e-01,  2.97132747e-01],
        [-1.40273925e+01, -2.98358401e+00,  2.12102376e+03,
          7.67958025e-01,  2.66504375e+00,  5.97611894e-02,
          3.33638861e-01,  2.94941868e-01],
        [-1.40415085e+01, -2.98589629e+00,  2.12102327e+03,
          7.79546636e-01,  2.62963747e+00,  5.96686362e-02,
          3.37176849e-01,  2.92765633e-01],
        [-1.41237337e+01, -2.96098469e+00,  2.12102455e+03,
          7.50069417e-01,  2.76495985e+00,  5.94284321e-02,
          3.41394508e-01,  2.89749717e-01],
        [-1.43006120e+01, -2.97932309e+00,  2.12102362e+03,
          7.55802007e-01,  2.72834737e+00,  5.85738245e-02,
          3.30134402e-01,  2.95412857e-01],
        [-1.42877093e+01, -2.95209036e+00,  2.12102465e+03,
          7.40160610e-01,  2.80327679e+00,  5.86269314e-02,
          3.30279881e-01,  2.98339433e-01],
        [-1.41519031e+01, -2.98376030e+00,  2.12102370e+03,
          7.38354293e-01,  2.84210216e+00,  5.86667564e-02,
          3.34856356e-01,  2.93066757e-01]]),
 array([27766.77120307, 27770.65977336, 27765.42249167, 27766.66039097,
        27152.20540997, 27767.77932639, 27771.51155652, 27770.91347686,
        26897.2850683 , 27127.78012839, 27765.83306709, 27771.5825209 ,
        27769.20168835, 27768.53255342, 27769.20308167, 27765.60641397,
        27768.04514652, 27768.59565483, 27769.70515558, 27769.76262386,
        27770.43934585, 27768.21566345, 27767.21439633, 27769.73292856]),
 ('MT19937', array([2759225150, 4157742838, 1483674071, 3488712351, 1707676183,
         2679032296, 1404648607,  674483824,  505243142, 3037889532,
         3906629912,  457795781,  601728573, 1901260323,  161924571,
          968754777, 3197895274, 3595636246, 3010204697, 1650660438,
         4145604492, 3680616097, 3817971461, 3331324680, 4208896039,
           11091017, 4065643595,  849474711, 3595280184, 1339880062,
         2198081676,  927489698, 3196675991, 4166862980, 4184451094,
          518353400, 2044110599, 2239578584, 2111248767,  684088402,
          591103307, 3527245033, 3756127603, 1041240866, 3389017260,
         3063682129, 2489922940, 3687244779, 3887258369, 1199933605,
         4163049896, 3070154662, 4126133829, 2876593967,  911195929,
         1166645782,  696102435, 3812542766, 1488224428, 3746583676,
         2836435359,  467752595, 1124843199, 3624054601,  907859268,
         2345497202, 2432446685,  548149909,  363976261, 2365323196,
         4028966007, 4257549824, 2685079423, 2725039370,   76169967,
         3266808378,  690020963, 1787412945, 2298273365,  722511724,
         3706820882,   84344834, 3619608326, 3383445119, 2447496571,
         1427988923, 2551827148, 3260758279,  567752818, 1421123420,
         2157039056, 3679917639, 3334279908,  888007865,  635588507,
         3037347120, 3038815080,  226207130, 2736133065, 1015958543,
         2734404214, 3952349484, 1794927239,  101111614, 2428078052,
         2044002145, 1714746961, 1225740062, 2753188009, 1532216724,
          334312404, 3190885079, 1596708490, 2871349932, 3986920423,
         3407351676,  779620117, 2969851086, 2782696507, 2795829013,
          528550598, 2928950001, 1420038991,  238917786, 1723699235,
         1639162997, 3019038953, 1737143619, 3978244404, 4010535648,
          595229704, 3017214860,  244801355, 2879257163, 1292907449,
         1504483163, 2248995326, 3189686258, 3296627068, 2695233655,
         1732087506, 3482043585, 1915339432, 2557084569, 3128017456,
          386945844, 1685873326, 3819508111, 2120971792,  321325413,
          329955914, 4219383341, 4280310237, 1080077178,  464140713,
         1011204014,  699585214, 2863664468, 3161683442, 1233445860,
          594585776, 2897373425, 2404408747, 3896904162, 1869986054,
          919318850, 2147214259, 2453093022,   78212570, 2513141202,
          799810343,  871187866, 3473166371, 1100883570, 1618802851,
         3332692369,  730871504, 2381836716, 2142429541,  330805219,
         2349794294, 3322037148, 3576282197, 1599295641, 2178427989,
         1676081042, 1753204828,  800533227, 1819824089, 1945856897,
         2368795752, 1796224956, 3407509050, 4007481022, 4199581001,
         2007888484, 3478851678, 2211611347, 1654002728, 4293014986,
         2954742226, 4111829974, 1154727339, 3429835348, 2696323858,
         1350041983, 3119475906, 1546886383,  504253722,  979896919,
         1997045251, 2345787292, 3369028275, 1248538061, 3733747811,
         1136833378, 2307649945,  497870595,  451232295, 3321361318,
         1620287233, 3737920091, 3077384357, 3913527305, 1708444628,
         2316705677, 4272983865, 3552112144, 1539320605, 3699310033,
         2318047540, 3745042799, 2975782778, 1803032090, 3706161031,
          163281995, 4165105502,  582149477, 1822669895, 3889998186,
          288780708, 1941966784, 1348792387, 3613530713, 1468889795,
         2599409082,  734043873, 1001355377, 2142352324, 4266805907,
         1979854445, 3007140809, 1185490291, 3322208460, 4227262638,
         2066396414, 3924284691,   38284969, 3237538451, 4277738081,
           70068865,  238114460, 3418515744,  815844670, 3832749043,
          266023988, 1870841950, 4057442667, 2921201897,  489989844,
         1552525782, 3222429677, 3615965552, 3524026031, 3913503617,
         4228517714, 1679981353, 3890661315, 3317265390, 1380430846,
          383185857,   67501477, 1221008638, 3554629198, 3442513277,
         1088172538, 3478075112,  401655987, 3614994440,    3460137,
          657466858, 4005047334, 3634019546,   11439709, 1329912378,
         3175226296,  852049977,  796214097, 2731299974, 2199068008,
         2935216901,   96981194,  642110811, 1531520922, 2346761729,
         3610916490,  834049997,  833477824,  753814935,  751774780,
         4027894947, 3627292288, 1309737094, 3769998231, 2342272436,
          732419905, 2167019893, 3959235704, 2640289875,   51320915,
         2339843862, 3289751924,  878393041, 2887206516, 3826169269,
         1045475624, 1368431695,  760493419, 4234933099, 1383798147,
          783845955, 2914682569, 1682537405,  464690310, 3351420637,
         3804000208,  844571323, 3632975105, 2468825884, 3650843585,
         3036560999, 3150390426, 2135278593, 3485263307, 4126740079,
         1156155049,  780863555, 1938553187,  890829986, 3710808979,
         4084242637, 3243350268, 3029949179, 3491709223,  834018644,
         3672234002, 1814949307,  915522419, 2967535694,  418493058,
          177727996, 2909709976,  356204975, 1819055666,  401168744,
         4023662654, 2229027249, 2812426492, 4233754823,  986577826,
         3872828667, 3999759883, 1476613751,   42138543,  786481751,
         3710693968, 2094646539, 2097365244,  555732836,  232148391,
         2207890767, 4288508738, 1924484623, 2746974882, 2783030606,
         2020660272, 1457846152, 2557210516, 3328044124, 2292487532,
         3947643562, 1605094440, 3497631947, 1564871372,  141797722,
         1603502354, 3025876119, 1491970340, 2699721908, 1172171209,
         2417426030, 4288198332, 3379287391,  591280955, 3095253312,
         4286994531, 2212349398,  413678396, 3973823714,  727490343,
         3436967781, 1798290348,  618140510,  575865092, 2364836051,
         1147537558, 2115892853,  956560937, 1844979198, 2353439681,
         1176375852, 1747181487, 3274985328, 3102477384, 1053082253,
         4020198304, 1861049858, 3879887390,  806859915, 1066416516,
         2054188504, 1286408583, 3485843795, 4062746689, 2798622870,
         2552745826,  909710698, 1081335569, 3611054740, 3509224622,
         1270392284, 2528202830, 3124917929, 2004708592, 1556198720,
         3888650185, 1747049834, 2993915604, 3883988296, 1575232502,
         1480873775, 4188623580, 1598943749, 2532645266, 1044214623,
         4087444629,  851001718, 1575876518, 1965328284, 2197419370,
          165939000, 2984302873, 1637184744, 3727383629, 4249177123,
          446947599, 1156615816, 1900558282, 2953207925, 3173355260,
         2150993049,  910551358, 2303508371, 2185356126, 1821406370,
         2758582140,  375734295, 3521267216, 3434232816, 2188501128,
          707312542, 3425414140,  731203859,  399904984, 1800113323,
         1237568624, 1222269720,  115492472, 1977600974, 2757559900,
         3018399618, 2798314357, 2760797415, 3296606265, 1102564242,
         3359627869, 1629082120, 2683135022, 1531474738,  226221629,
         3401550048, 2028841022, 2755530890, 2450147382, 4065492608,
         3729157888, 1505715438, 1285724449, 1134282092, 3668691435,
         1017802397, 2637010559,  694292719,  715831517, 1648207727,
          803530254,  383930836, 3013184316, 1796143153, 4201896376,
          364879002,  735812057, 3499081476, 1021467365, 1521944519,
          574568979, 2054157833, 1078814863, 1701852536, 1503935263,
         2887299082, 2339012258,  856817184,  152070426, 2401890315,
         4196823558, 3289541195,  168618387, 3162593315, 1962220133,
          792561377, 2468383235, 3328432870, 1783588737, 1536964294,
         2750433465, 4018634159, 1665038247, 2217789665, 3094655870,
         4235620987, 3262809432, 1908673630,  456815285,  697436958,
          530146509, 4201680400, 4243673782, 2335028468, 3217984131,
         1931955294, 3053152112, 2497852682, 1702856037,  523170932,
         4140490499,  222492173, 3044150178, 1149743696,  873500278,
         3729098178, 3895165866,  358211582, 1091591907, 3166934930,
         2598893219, 1498215530,  617224373, 1291671837, 4256284990,
         1181323083, 1642015512, 1732730875, 1160692423,  168651927,
         2828480764, 3357723953,  256878586, 4053117399, 1284308637,
          637411893, 2137906188, 2204360990, 3301916243, 2958714553,
          414635031,  617779992,  660916141, 2462313314, 1497581162,
         4293192337, 4201666179, 2570070022, 2656162343, 3528546268,
         3105404396,  645014028, 2464583376, 4271694255, 1461467814,
         4169375121, 1264611713, 2692356759,  613590436, 4151636016,
          286209636, 2470382676,  247650296, 1141147700, 4071581172,
         2366560656, 2275299462, 3060708803, 3865051912], dtype=uint32), 6, 0, 0.0))

In [38]:
# let's make an area of the samples and their names

st.samples = st.sampler.chain.reshape((-1, len(dists)))
st.samples = np.column_stack((st.samples,st.sampler.lnprobability.reshape(-1)))

st.sampleheaders=list(st.gp.get_parameter_names())+['logprob']

Or...

you can do all of the above lines since the "Running a model MCMC title with the following command:


In [35]:
st.RunMCMC()


{'mean:tcen': [2120.87, 2121.17], 'mean:b': [0.0, 1.25], 'mean:vel': [0, 5.579722818533527, 'normlim', 3.564056844460287, 0.40313319481464793], 'mean:RpRs': [0.02, 0.25], 'mean:LD1': [0, 1.0, 'gaussian', 0.3399126190774876, 0.038077971487568155], 'mean:LD2': [0, 1.0, 'gaussian', 0.29606961222900485, 0.021868467077842395]}
EMCEE HAPPENING. INIT DISTS:
[2.12105204e+03 6.36663424e-01 3.81799383e+00 4.31977941e-02
 3.49721185e-01 2.90034327e-01]
['mean:tcen', 'mean:b', 'mean:vel', 'mean:RpRs', 'mean:LD1', 'mean:LD2']
dict_keys(['mean:tcen', 'mean:b', 'mean:vel', 'mean:RpRs', 'mean:LD1', 'mean:LD2'])

Now let's save the MCMC samples and plot the MCMC result:


In [39]:
st.SaveMCMC()

In [45]:
st.PlotMCMC()


203311200 Plotting MCMC corner
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
WARNING:root:Too few points to create valid contours
<matplotlib.figure.Figure at 0x1175a0c50>

Without GPs:


In [77]:
st_nogp=namaste.Star('203311200',namaste.Settings(nsteps=1000,nthreads=4,mission='K2'))

st_nogp.settings.update(GP=False)
st_nogp.settings.update(verbose=False)


2018-10-20 18:11:56,237 INFO 122:namaste.py(50345) - 203311200 - initialising Star object
INFO:namaste:203311200 - initialising Star object

In [78]:
#Or you can use a csv file, for example:
st_nogp.csvfile_dat('ExampleData/EPIC203311200_beststelpars.csv')

#Initialising LDs:
st_nogp.initLD()


2018-10-20 18:11:56,943 INFO 156:namaste.py(50345) - 203311200 - Getting information from csv
INFO:namaste:203311200 - Getting information from csv
/Users/hosborn/Postdoc/K2/Namaste_2/namaste/namaste.py:158: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls
  df=pd.DataFrame.from_csv(file)

In [79]:
#Adding a lightcurve:
st_nogp.addLightcurve('/Volumes/CHEOPS/K2_MONOS/BestLCs/EPIC203311200_bestlc_ev.npy')


(3515, 3)
/Users/hosborn/Postdoc/K2/Namaste_2/namaste/namaste.py:1289: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls
  kicdat=pd.DataFrame.from_csv("https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=k2targets&where=epic_number=%27"+str(int(kic))+"%27")
Out[79]:
<namaste.namaste.Lightcurve at 0x11c74b128>

In [80]:
#When we're not doing GPs, lets flatten the LC:
st_nogp.Lcurve.lc=st_nogp.Lcurve.flatten()

In [81]:
plt.plot(st_nogp.Lcurve.lc[:,0],st_nogp.Lcurve.lc[:,1],'.')
plt.plot(st_nogp.Lcurve.lc[st_nogp.Lcurve.lcmask,0],st_nogp.Lcurve.lc[st_nogp.Lcurve.lcmask,1],',')


Out[81]:
[<matplotlib.lines.Line2D at 0x114d04d30>]

In [88]:
#Adds this to mono1
st_nogp.AddMonotransit(2121.02,0.5,0.0032,name='mono1')

#Now we have our mean-functions (eg transit models) added, we need to build the priors and the model:
st_nogp.BuildMeanPriors()


2018-10-20 18:23:27,634 INFO 1023:namaste.py(50345) - 203311200.1 - monopriors: mean:tcen - [2120.87, 2121.17] , mean:b - [0.0, 1.25] , mean:vel - [0, 5.4903083994500745, 'normlim', 3.5736491649686775, 0.3833318468962794] , mean:RpRs - [0.02, 0.25] , mean:LD1 - [0, 1.0, 'gaussian', 0.339679200660016, 0.038476153186633194] , mean:LD2 - [0, 1.0, 'gaussian', 0.295936861708641, 0.022151103527701013]
INFO:namaste:203311200.1 - monopriors: mean:tcen - [2120.87, 2121.17] , mean:b - [0.0, 1.25] , mean:vel - [0, 5.4903083994500745, 'normlim', 3.5736491649686775, 0.3833318468962794] , mean:RpRs - [0.02, 0.25] , mean:LD1 - [0, 1.0, 'gaussian', 0.339679200660016, 0.038476153186633194] , mean:LD2 - [0, 1.0, 'gaussian', 0.295936861708641, 0.022151103527701013]
2018-10-20 18:23:27,642 INFO 1025:namaste.py(50345) - 203311200.1 - nll init: 2375.783092262186
INFO:namaste:203311200.1 - nll init: 2375.783092262186
2018-10-20 18:23:52,916 INFO 1048:namaste.py(50345) - 203311200.1 - mono opt, Best Results:2121.023968717218 , 0.7868651518286128 , 2.6169560790026534 , 0.058475207050375115 , 0.1358330260599801 , 0.29597158586826544 , 1170.0458538629673
INFO:namaste:203311200.1 - mono opt, Best Results:2121.023968717218 , 0.7868651518286128 , 2.6169560790026534 , 0.058475207050375115 , 0.1358330260599801 , 0.29597158586826544 , 1170.0458538629673
2018-10-20 18:23:52,925 INFO 1051:namaste.py(50345) - 203311200.1initial fit nll: 2375.783092262186 to new fit nll: 1 , 1 , 7 , 0 , . , 0 , 4 , 5 , 8 , 5 , 3 , 8 , 6 , 2 , 9 , 6 , 7 , 3
INFO:namaste:203311200.1initial fit nll: 2375.783092262186 to new fit nll: 1 , 1 , 7 , 0 , . , 0 , 4 , 5 , 8 , 5 , 3 , 8 , 6 , 2 , 9 , 6 , 7 , 3

In [90]:
#Accessing pure transit fit:

st_nogp.BuildMeanModel()
model=st_nogp.meanmodel_comb.get_value(np.arange(2120.6,2121.4,0.005))
plt.plot(st_nogp.Lcurve.lc[abs(st_nogp.Lcurve.lc[:,0]-st_nogp.mono1.tcen)<1.5,0],st_nogp.Lcurve.lc[abs(st_nogp.Lcurve.lc[:,0]-st_nogp.mono1.tcen)<1.5,1],'.')
plt.plot(np.arange(2120.6,2121.4,0.005),model,'--')


Out[90]:
[<matplotlib.lines.Line2D at 0x11770d320>]

In [91]:
st_nogp.RunMCMC()


2018-10-20 18:32:10,375 INFO 524:namaste.py(50345) - 203311200 - Priors set as mean:tcen - [2120.87, 2121.17] , mean:b - [0.0, 1.25] , mean:vel - [0, 5.4903083994500745, 'normlim', 3.5736491649686775, 0.3833318468962794] , mean:RpRs - [0.02, 0.25] , mean:LD1 - [0, 1.0, 'gaussian', 0.339679200660016, 0.038476153186633194] , mean:LD2 - [0, 1.0, 'gaussian', 0.295936861708641, 0.022151103527701013]
INFO:namaste:203311200 - Priors set as mean:tcen - [2120.87, 2121.17] , mean:b - [0.0, 1.25] , mean:vel - [0, 5.4903083994500745, 'normlim', 3.5736491649686775, 0.3833318468962794] , mean:RpRs - [0.02, 0.25] , mean:LD1 - [0, 1.0, 'gaussian', 0.339679200660016, 0.038476153186633194] , mean:LD2 - [0, 1.0, 'gaussian', 0.295936861708641, 0.022151103527701013]
2018-10-20 18:32:10,638 INFO 571:namaste.py(50345) - 203311200 - EMCEE HAPPENING. INIT DISTS:
INFO:namaste:203311200 - EMCEE HAPPENING. INIT DISTS:
2018-10-20 18:32:10,640 INFO 572:namaste.py(50345) - 2033112002120.994080992583 , 0.4602249937935987 , 3.472529536925194 , 0.04209886474453508 , 0.31301143176265883 , 0.3090804868454484
INFO:namaste:2033112002120.994080992583 , 0.4602249937935987 , 3.472529536925194 , 0.04209886474453508 , 0.31301143176265883 , 0.3090804868454484
2018-10-20 18:32:10,643 INFO 584:namaste.py(50345) - 203311200mean:tcen , mean:b , mean:vel , mean:RpRs , mean:LD1 , mean:LD2
INFO:namaste:203311200mean:tcen , mean:b , mean:vel , mean:RpRs , mean:LD1 , mean:LD2
2018-10-20 18:32:10,647 INFO 585:namaste.py(50345) - 203311200mean:tcen , mean:b , mean:vel , mean:RpRs , mean:LD1 , mean:LD2
INFO:namaste:203311200mean:tcen , mean:b , mean:vel , mean:RpRs , mean:LD1 , mean:LD2

In [94]:
st_nogp.SaveMCMC(suffix='NoGP',overwrite=True)

In [99]:
st_nogp.PlotMCMC(suffix='NoGP')


2018-10-20 18:47:42,878 INFO 656:namaste.py(50345) - 203311200 - Plotting MCMC corner
INFO:namaste:203311200 - Plotting MCMC corner
<matplotlib.figure.Figure at 0x11b464b70>