CONAN._classes.load_result
==========================

.. toctree::
   :hidden:

   /autoapi/CONAN/_classes/load_result._create_res_obj
   /autoapi/CONAN/_classes/load_result._evaluate_lc
   /autoapi/CONAN/_classes/load_result._evaluate_rv
   /autoapi/CONAN/_classes/load_result._get_lcbaseline
   /autoapi/CONAN/_classes/load_result._get_rvbaseline
   /autoapi/CONAN/_classes/load_result._load_result_array
   /autoapi/CONAN/_classes/load_result._plot_bestfit_lc
   /autoapi/CONAN/_classes/load_result._plot_bestfit_rv
   /autoapi/CONAN/_classes/load_result._ttv_lcplot
   /autoapi/CONAN/_classes/load_result._ttvplot
   /autoapi/CONAN/_classes/load_result.get_all_params_dict
   /autoapi/CONAN/_classes/load_result.make_output_file
   /autoapi/CONAN/_classes/load_result.plot_burnin_chains
   /autoapi/CONAN/_classes/load_result.plot_chains
   /autoapi/CONAN/_classes/load_result.plot_corner
   /autoapi/CONAN/_classes/load_result.plot_posterior

.. py: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

   :param folder: folder where the output files are located. Default is "output".
   :type folder: str;
   :param chain_file: name of the file containing the posterior chains. Default is "chains_dict.pkl".
   :type chain_file: str;
   :param burnin_chain_file: name of the file containing the burn-in chains. Default is "burnin_chains_dict.pkl".
   :type burnin_chain_file: str;
   :param quick_load: quickly load only the basic information of the fit, chains and stats. Default is False.
   :type quick_load: bool;
   :param verbose: print output. Default is True.
   :type verbose: bool;

   .. attribute:: _chains

      dictionary of posterior chains

      :type: dict;

   .. attribute:: _burnin_chains

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

      :type: dict;

   .. attribute:: _par_names

      list of names for fitted parameters

      :type: list;

   .. attribute:: _ind_para

      dictionary of individual parameters used in configuring the fit

      :type: dict;

   .. attribute:: _lcnames

      list of names of the light curves

      :type: list;

   .. attribute:: _rvnames

      list of names of the RV files

      :type: list;

   .. attribute:: _nplanet

      number of planets

      :type: int;

   .. attribute:: fit_sampler

      sampler used for the fit

      :type: str;

   .. attribute:: _ttvs

      whether TTVs were fitted

      :type: str;

   .. attribute:: _stat_vals

      dictionary of summary statistics of the fit

      :type: dict;

   .. attribute:: params

      namespace of fitted parameters

      :type: SimpleNamespace;

   .. attribute:: _folder

      folder where the output files are located

      :type: str;

   .. attribute:: _obj_type

      type of object. Default is "result_obj"

      :type: str;

   :returns: **load_result**
   :rtype: load_result object

   .. rubric:: 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


   .. py:attribute:: _folder
      :value: 'output'



   .. py:attribute:: _ind_para


   .. py:attribute:: _lcnames


   .. py:attribute:: _nplanet


   .. py:attribute:: _obj_type
      :value: 'result_obj'



   .. py:attribute:: _par_names


   .. py:attribute:: _rvnames


   .. py:attribute:: _ttvs


   .. py:attribute:: evidence


   .. py:attribute:: fit_sampler


   .. py:attribute:: params_dict

Methods
-------

.. autoapisummary::

   CONAN._classes.load_result._create_res_obj
   CONAN._classes.load_result._evaluate_lc
   CONAN._classes.load_result._evaluate_rv
   CONAN._classes.load_result._get_lcbaseline
   CONAN._classes.load_result._get_rvbaseline
   CONAN._classes.load_result._load_result_array
   CONAN._classes.load_result._plot_bestfit_lc
   CONAN._classes.load_result._plot_bestfit_rv
   CONAN._classes.load_result._ttv_lcplot
   CONAN._classes.load_result._ttvplot
   CONAN._classes.load_result.get_all_params_dict
   CONAN._classes.load_result.make_output_file
   CONAN._classes.load_result.plot_burnin_chains
   CONAN._classes.load_result.plot_chains
   CONAN._classes.load_result.plot_corner
   CONAN._classes.load_result.plot_posterior


