CONAN._classes.load_result#

class CONAN._classes.load_result(folder='output', chain_file='chains_dict.pkl', burnin_chain_file='burnin_chains_dict.pkl', quick_load=False, verbose=True)#

Load results from emcee/dynesty run

Parameters:
  • folder (str;) – folder where the output files are located. Default is “output”.

  • chain_file (str;) – name of the file containing the posterior chains. Default is “chains_dict.pkl”.

  • burnin_chain_file (str;) – name of the file containing the burn-in chains. Default is “burnin_chains_dict.pkl”.

  • quick_load (bool;) – quickly load only the basic information of the fit, chains and stats. Default is False.

  • verbose (bool;) – print output. Default is True.

_chains#

dictionary of posterior chains

Type:

dict;

_burnin_chains#

dictionary of burn-in chains if emcee was used for sampling

Type:

dict;

_par_names#

list of names for fitted parameters

Type:

list;

_ind_para#

dictionary of individual parameters used in configuring the fit

Type:

dict;

_lcnames#

list of names of the light curves

Type:

list;

_rvnames#

list of names of the RV files

Type:

list;

_nplanet#

number of planets

Type:

int;

fit_sampler#

sampler used for the fit

Type:

str;

_ttvs#

whether TTVs were fitted

Type:

str;

_stat_vals#

dictionary of summary statistics of the fit

Type:

dict;

params#

namespace of fitted parameters

Type:

SimpleNamespace;

_folder#

folder where the output files are located

Type:

str;

_obj_type#

type of object. Default is “result_obj”

Type:

str;

Returns:

load_result

Return type:

load_result object

Examples

>>> result = CONAN.load_result(folder="output")

different plots from the result object

>>> fig    = result.plot_corner()                     # corner plot
>>> fig    = result.plot_burnin_chains()              # burn-in chains
>>> fig    = result.plot_chains()                     # posterior chains
>>> fig    = result.lc.plot_bestfit(detrend=True)     # model of the light curves
>>> fig    = result.rv.plot_bestfit(detrend=True)     # model of the RV curves
>>> fig    = result.lc.plot_ttv()                     # plot the TTVs
>>> fig    = result.lc.plot_lcttv()                   # plot the light curves showing the TTVs

get the best-fit parameters

>>> med_pars = result.params.median                   # median values of the fitted parameters
>>> stdev    = result.params.stdev                    # standard deviation of the fitted parameters
>>> pars_dict= result.get_all_params_dict(stat="med") # get all parameters (fitted, derived, and fixed) as a dictionary

load files

>>> out_lc  = result.lc.out_data()    # output data of the light curves i.e *_lcout.dat files
>>> out_rv  = result.rv.out_data()    # output data of the RV curves i.e *_rvout.dat files
>>> in_lc   = result.lc.in_data()     # input light curves
>>> in_rv   = result.rv.in_data()     # input RV data

evaluate model (lc or rv) at user-defined times

>>> t      = np.linspace(0,1,1000)
>>> model  = result.lc.evaluate(file="lc1.dat", time=t, params= result.params.median,
>>>                             return_std=True)  # model of the light curve "lc1.dat" at user time t
>>> lc_mod = model.planet_model      # model of the planet
>>> comps  = model.components        # for multiplanet fit, this will be a dict with lc_mod for each planet. i.e. comps["pl_1"] for planet 1
>>> sigma_low, sigma_hi = model.sigma_low, model.sigma_hi    # lower and upper 1-sigma model uncertainties that can be plotted along with lc_mod
_folder = 'output'#
_ind_para#
_lcnames#
_nplanet#
_obj_type = 'result_obj'#
_par_names#
_rvnames#
_ttvs#
evidence#
fit_sampler#
params_dict#

Methods#

_create_res_obj([data])

_evaluate_lc([file, time, params, nsamp, return_std])

Compute planet transit model from fit for a given input file at the given times using specified parameters.

_evaluate_rv([file, time, params, nsamp, return_std])

Compute planet RV model from CONAN fit for a given input file at the given times using specified parameters.

_get_lcbaseline([file, params, nsamp, return_std])

Compute LC baseline model from CONAN fit for a given input file using specified parameters.

_get_rvbaseline([file, params, nsamp, return_std])

Compute RV baseline model from CONAN fit for a given input file using specified parameters.

_load_result_array([data, verbose])

Load result array from CONAN fit allowing for customised plots.

_plot_bestfit_lc([plot_cols, detrend, col_labels, ...])

Plot the best-fit model of the input data.

_plot_bestfit_rv([plot_cols, detrend, col_labels, ...])

Plot the best-fit model of the input data.

_ttv_lcplot([figsize, binsize, offset, sort_lcs, ...])

plot the stacked individual transits of each planet in the system using linear ephemeris revealing the presence of TTVs.

_ttvplot([figsize])

plot the transit times of the individual planets in the system having subtracted the best-fit linear ephemeris model.

get_all_params_dict([stat, uncertainty, return_type, ...])

Get all parameters(jumping,derived,fixed) from the result_**.dat and load in a dictionary with uncertainties.

make_output_file([stat, out_folder])

make output model file ('_*out.dat') from parameters obtained using different summary

plot_burnin_chains([pars, figsize, thin, discard, ...])

Plot chains of selected parameters.

plot_chains([pars, figsize, thin, discard, alpha, ...])

Plot chains of selected parameters.

plot_corner([pars, bins, thin, discard, q, range, ...])

Corner plot of selected parameters.

plot_posterior(par[, thin, discard, bins, density, ...])

Plot the posterior distribution of a single input parameter, par.