o
    ØËh”  ã                   @   s   d Z ddlZdd„ ZdS )z9Tools for spectral analysis of unequally sampled signals.é    Nc                 C   sÜ  | j |j kr
tdƒ‚t |¡}t | ¡}t | ¡}t|j d ƒD ]Ë}d}d}d}	d}
d}t || |  ¡|dd…< t || |  ¡|dd…< t| j d ƒD ]4}||| ||  7 }||| ||  7 }|	|| ||  7 }	|
|| ||  7 }
||| ||  7 }qM|| dkr‹tƒ ‚t d| |	|
 ¡d||   }t || | ¡}t || | ¡}|| }|| }d| | }d|| ||  d ||	 ||  ||
   || ||  d ||
 ||  ||	     ||< q |S )a"  
    _lombscargle(x, y, freqs)

    Computes the Lomb-Scargle periodogram.

    Parameters
    ----------
    x : array_like
        Sample times.
    y : array_like
        Measurement values (must be registered so the mean is zero).
    freqs : array_like
        Angular frequencies for output periodogram.

    Returns
    -------
    pgram : array_like
        Lomb-Scargle periodogram.

    Raises
    ------
    ValueError
        If the input arrays `x` and `y` do not have the same shape.

    See also
    --------
    lombscargle

    z'Input arrays do not have the same size.r   g        Né   g      à?)	ÚshapeÚ
ValueErrorÚnpÚ
empty_likeÚrangeÚcosÚsinÚZeroDivisionErrorÚarctan2)ÚxÚyÚfreqsÚpgramÚcÚsÚiÚxcÚxsÚccÚssÚcsÚjÚtauÚc_tauÚs_tauÚc_tau2Ús_tau2Úcs_tau© r   úQ/var/www/html/scripts/venv/lib/python3.10/site-packages/scipy/signal/_spectral.pyÚ_lombscargle	   sF    


 ÿÿþr!   )Ú__doc__Únumpyr   r!   r   r   r   r    Ú<module>   s   