CONAN._classes.load_lightcurves.add_sinusoid
============================================

.. py:method:: CONAN._classes.load_lightcurves.add_sinusoid(lc_list=None, trig='sin', n=1, par='col0', Amp=0, P=2 * np.pi, x0=0, verbose=True)

   Add sinusoid to fit correlation along a column of the data. This fits a sinusoid to the
   column data using the given period, amplitude and zero phase.

   For ``trig='sin'``,

   .. math ::

       sinusoid =  \sum_{1}^{n} (Amp * \sin(n*2\pi/P*(x-x_0)))

   and similar for ``trig='cos'``.

   For ``trig='sincos'``,

   .. math ::

       sinusoid =  \sum_{1}^{n} (Amp*\sin(n*2\pi/P*(x-x_0)) + Amp * \cos(n*2\pi/P*(x-x0)))

   All arguments can be given as a list to specify config for each lc file in lc_list.
   To directly fit the trig function to the column array i.e sin(colx), set x0=0, and P=2*np.pi.

   :param lc_list: list of lc files to fit a sinusoid to. set to "all" for unique sinusoid for each lc
                   files, "same" for a single sinusoid for all, or "filt" for filter dependent sinusoid.
                   Default is None for no sinusoid.
   :type lc_list: list, str: file_name or one of ["all","same","filt"], optional
   :param trig: trigonometric function to fit. must be one of ['sin','cos','sincos']. Default is 'sin'.
                Give list of trig functions if different for each lc file. e.g. ["sin","cos"] for sin(x)
                for lc1.dat and cos(x) for lc2.dat.
   :type trig: str, list, optional
   :param n: number of harmonics of the sinusoid to fit. Default is 1 for only sin(x)/cos(x)/sin(x)cos(x) term, 2 for
             sin(2x), .... max value is 3
   :type n: int, list, optional
   :param par: column of input data representing the independent variable x of the sinusoid. must be
               one of ["col0","col3","col4","col5","col6","col7","col8"]. Default is "col0". Give list
               of columns if different for each lc file. e.g. ["col0","col3"] for sinusoid in col0 for
               lc1.dat and col3 for lc2.dat.
   :type par: str, list, optional
   :param P: period of the sinusoid in same unit as column array specified in `par`. Default is 2𝜋.
   :type P: float, tuple, list, optional
   :param amp: amplitude of the sinusoid function in ppm. Default is None.
   :type amp: float, tuple, list, optional
   :param x0: zero phase of the sinusoid in units of column array specified in `par`. Default is 0.
   :type x0: float, tuple, list, optional
   :param verbose: print output. Default is True.
   :type verbose: bool, optional

   .. attribute:: _sine_dict

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

      :type: dict

   .. rubric:: Examples

   To use different sinusoid configuration for 2 lc files

   >>> lc_obj.add_sinusoid(lc_list = ["lc1.dat","lc2.dat"],
   >>>                     par     = ["col0","col4"],
   >>>                     P       = [1,2],
   >>>                     amp     = [0.1,0.2],
   >>>                     phase   = [0,1] )

