CONAN._classes.load_lightcurves.add_sinusoid#

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',

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

and similar for trig='cos'.

For trig='sincos',

\[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.

Parameters:
  • lc_list (list, str: file_name or one of ["all","same","filt"], optional) – 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.

  • trig (str, list, optional) – 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.

  • n (int, list, optional) – 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

  • par (str, list, optional) – 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.

  • P (float, tuple, list, optional) – period of the sinusoid in same unit as column array specified in par. Default is 2𝜋.

  • amp (float, tuple, list, optional) – amplitude of the sinusoid function in ppm. Default is None.

  • x0 (float, tuple, list, optional) – zero phase of the sinusoid in units of column array specified in par. Default is 0.

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

_sine_dict#

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

Type:

dict

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] )