CONAN._classes.fit_setup
========================

.. toctree::
   :hidden:

   /autoapi/CONAN/_classes/fit_setup._stellar_parameters
   /autoapi/CONAN/_classes/fit_setup.print
   /autoapi/CONAN/_classes/fit_setup.sampling

.. py:class:: CONAN._classes.fit_setup(R_st=None, M_st=None, par_input='Rrho', apply_LCjitter='y', apply_RVjitter='y', apply_LC_GPndim_jitter='y', apply_RV_GPndim_jitter='y', apply_LC_GPndim_offset='y', apply_RV_GPndim_offset='y', LCjitter_loglims='auto', RVjitter_lims='auto', LCbasecoeff_lims='auto', RVbasecoeff_lims='auto', leastsq_for_basepar='n', LTT_corr='n', verbose=True)

   class to configure mcmc run

   :param R_st: stellar radius and mass (in solar units) to use for calculating absolute dimensions.
                R_st is also used in calculating light travel time correction. Only one of these is
                needed, preferrably R_st. First tuple element is the value and the second is the uncertainty
   :type R_st: tuple of length 2 ;
   :param M_st: stellar radius and mass (in solar units) to use for calculating absolute dimensions.
                R_st is also used in calculating light travel time correction. Only one of these is
                needed, preferrably R_st. First tuple element is the value and the second is the uncertainty
   :type M_st: tuple of length 2 ;
   :param par_input: input method of stellar parameters. It can be one of  ["Rrho","Mrho"], to use the fitted
                     stellar density and one stellar parameter (M_st or R_st) to compute the other stellar
                     parameter (R_st or M_st). Default is 'Rrho' to use the fitted stellar density and
                     stellar radius to compute the stellar mass.
   :type par_input: str;
   :param leastsq_for_basepar: whether to use least-squares fit within the mcmc to fit for the baseline. This reduces
                               the computation time especially in cases with several input files. Default is "n".
   :type leastsq_for_basepar: "y" or "n";
   :param apply_RVjitter: whether to apply a jitter term for the fit of RV data. Default is "y". A List can be
                          given to specify y/n for each RV.
   :type apply_RVjitter: "y" or "n";
   :param apply_LCjitter: whether to apply a jitter term for the fit of LC data. Default is "y". A List can be
                          given to specify y/n for each LC.
   :type apply_LCjitter: "y" or "n";
   :param LCjitter_loglims: log limits of uniform prior for the LC jitter term. Default is "auto" which automatically
                            determines the limits for each lcfile as [-15,log(10*mean(LCerr))].
   :type LCjitter_loglims: "auto" or list of length 2: [lo_lim,hi_lim];
   :param RVjitter_lims: limits of uniform prior for the RV jitter term. Default is "auto" which automatically
                         determines the limits for each rvfile as [0,10*mean(RVerr)].
   :type RVjitter_lims: "auto" or list of length 2:[lo_lim,hi_lim];
   :param LCbasecoeff_lims: limits of uniform prior for the LC baseline coefficients default. Default is "auto"
                            which automatically determines the limits from data properties.
   :type LCbasecoeff_lims: "auto" or list of length 2: [lo_lim,hi_lim];
   :param RVbasecoeff_lims: limits of uniform prior for the RV baseline coefficients. Dafault is "auto" which
                            automatically determines the limits from data properties.
   :type RVbasecoeff_lims: "auto" or list of length 2: [lo_lim,hi_lim];
   :param LTT_corr: whether to apply light travel time correction to the LC data. Default is "n".
   :type LTT_corr: "y" or "n";
   :param apply_LC_GPndim_jitter: whether to apply a jitter term for each of the timeseries in the spleaf multi-dim GP fit.
                                  Default is "y". A List can be given to specify y/n for each LC.
   :type apply_LC_GPndim_jitter: "y" or "n";
   :param apply_RV_GPndim_jitter: whether to apply a jitter term for each of the timeseries in the spleaf multi-dim
                                  GP fit. Default is "y". A List can be given to specify y/n for each timeseries.
   :type apply_RV_GPndim_jitter: "y" or "n";
   :param apply_LC_GP_ndim_offset: whether to apply an offset for each of the LC timeseries in the spleaf multi-dim GP
   :type apply_LC_GP_ndim_offset: "y" or "n";
   :param apply_RV_GP_ndim_offset: whether to apply an offset for each of the RV timeseries in the spleaf multi-dim GP
   :type apply_RV_GP_ndim_offset: "y" or "n";
   :param verbose: print output. Default is True.
   :type verbose: bool;
   :param Other keyword arguments to the emcee or dynesty sampler functions (`run_mcmc()` or:
   :param `run_nested()`) can be given in the call to `CONAN.run_fit()`.:

   .. attribute:: _obj_type

      type of object. Default is "fit_obj"

      :type: str;

   .. attribute:: _lcobj

      light curve object. Default is None.

      :type: lc_obj;

   .. attribute:: _rvobj

      RV object. Default is None.

      :type: rv_obj;

   .. attribute:: _stellar_parameters

      method to compute stellar parameters.

      :type: method;

   .. attribute:: _fit_dict

      dictionary of fit configuration

      :type: dict;

   :returns: **fit_obj**
   :rtype: fit object

   .. rubric:: Examples

   >>> fit_obj = CONAN.fit_setup(  R_st            = (1,0.01),
   >>>                             M_st            = (1,0.01),
   >>>                             par_input       = "Rrho",
   >>>                             apply_LCjitter  = "y",
   >>>                             apply_RVjitter  = "y")
   >>> fit_obj.sampling(   sampler = "emcee",
   >>>                     ncpus   = 2,
   >>>                     n_chains= 64,
   >>>                     n_steps = 2000,
   >>>                     n_burn  = 500)


   .. py:attribute:: _fit_dict


   .. py:attribute:: _fitobj


   .. py:attribute:: _lcobj


   .. py:attribute:: _obj_type
      :value: 'fit_obj'



   .. py:attribute:: _rvobj

Methods
-------

.. autoapisummary::

   CONAN._classes.fit_setup._stellar_parameters
   CONAN._classes.fit_setup.print
   CONAN._classes.fit_setup.sampling


