CONAN._classes.load_lightcurves.add_GP
======================================

.. py:method:: CONAN._classes.load_lightcurves.add_GP(lc_list=None, par=['col0'], kernel=['mat32'], operation=[''], amplitude=[], lengthscale=[], h3=None, h4=None, gp_pck='ce', verbose=True)

   Define GP hyperparameters for each lc. The first hyperparameter h1 is amplitude (standard deviation)
   in ppm while the second h2 is lengthscale in unit of the desired column. h3 and h4 are the
   3rd and 4th hyperparameters whose definitions depend on the choice of gp kernel.
   see https://github.com/titans-ge/CONAN/wiki/Gaussian-Processes-with-CONAN

   The priors for the hyperparameters can be defined in following ways:

   - fixed value as float or int, e.g amplitude = 2

   - normal prior as tuple of len 2, (mu, std) e.g. amplitude = (2, 1)

   - uniform (or loguniform prior) as tuple of length 3, (min,start, max) e.g. amplitude = (1,2,5)
   - loguniform: add "LU" to a  for loguniform e.g (1,2,5,"LU")
   - truncnorm as tuple of length 4, (min, max, mu, std) e.g. q1 = (0,1,0.3,0.1)

   Note: using GP on a lc sets fit_offset="n" for that lc. users can turn it back on for each lc
   from the ._fit_offset list attribute. e.g. lc_obj._fit_offset = ["y","y","y"]

   If multiplying GP kernels together, the amplitudes are degenerate and only one amplitude is
   required, that of the first kernel. set the other amplitudes to –1 to disable them.

   :param lc_list: list of lc files to add GP to. Default is None for no GP. if "all" is given, GP is added
                   to all lc files where gp use has been indicated in ``lc_baseline()``. If "same" is
                   given, a global (same) GP is used for all indicated lc files in ``lc_baseline()``.
   :type lc_list: str, list;
   :param par: column of the input data to use as the GP independent variable. a list is expected if
               different columns are to be used for the lc files given in lc_list. To use 2 different
               kernels on a single lc file, give column name for each kernel as a tuple of length 2.
               e.g. lc_list=["lc1.dat","lc2.dat"], par = [("col0","col0"),"col3"] to use col0 for both
               kernels of lc1, and col3 for lc2.
   :type par: str, tuple, list;
   :param kernel: kernel to use for the GP.

                  - if `George` package,  kernel must be in ['mat32', 'mat52', 'exp', 'cos', 'expsq','exps2','qp','rquad']

                  - if `celerite` package, kernel must in ['mat32', 'exp', 'cos', 'sho','qp_ce']

                  - if `spleaf` package, kernel must be in ['mat32', 'mat52', 'exp', 'cos', 'sho', 'expsq', 'exps2', 'qp', 'qp_sc', 'qp_mp']
   :type kernel: str, tuple, list;

       Note that the kernel names have been unified for consistency across the 3 packages.
       The george 'cos' kernel is similarly reimplemented for celerite and spleaf. The celerite
       'exp' kernel is the native package's `RealTerm`. The spleaf 'expsq' kernel is the native
       package's `ESKernel`.

       A list is expected if different kernels are to be used for the lc files given in lc_list.
       To use 2 different kernels on a single lc file, give kernel name for each kernel as a
       tuple of length 2. e.g. lc_list=["lc1.dat","lc2.dat"], kernel=[("mat32","expsq"),"exp"]
       to use mat32 and expsq for lc1, and exp for lc2.
   operation : str, tuple, list;
       operation to combine kernels. Must be one of ["+","*"]. Default is "" for no combination.
   amplitude : float, tuple, list;
       amplitude of the GP kernel in ppm. Must be list of int/float or tuple of length 2/3/4
   lengthscale : float, tuple, list;
       lengthscale of the GP kernel in units of the column array specified in `par`. Must be
       list of int/float or tuple of length 2/3/4
   h3 : float, tuple, list;
       3rd hyperparameter of the GP kernel. Must be list of int/float or tuple of length 2/3/4
   h4 : float, tuple, list;
       4th hyperparameter of the GP kernel. Must be list of int/float or tuple of length 2/3/4
   gp_pck : str, list;
       package to use for the GP. Must be one of ["ge","ce","sp"]. Default is "ce" for celerite.
       A str or list of str can be given to specify package for each lc file in GP lc_list.
   verbose : bool;
       print output. Default is True.

   .. attribute:: _GP_dict

      dictionary of GP configuration for each lc file. Default is None for no GP.

      :type: dict

   .. attribute:: _sameLCgp

      flag to indicate if same GP is to be used for all lcs. Default is False.

      :type: SimpleNamespace

   .. attribute:: _useGPphot

      list of GP packages to use for each lc file. Default is None for no GP.

      :type: list

   .. attribute:: _allLCgp

      flag to indicate if GP is to be used for all lcs. Default is False.

      :type: bool

   .. attribute:: _fit_offset

      list of flags to indicate if offset is to be fit for each lc file. Default is "y" for all.
      This is set to "n" for the lcs where GP is used.

      :type: list

