
    xf                         d Z ddlZd Zy)z9Tools for spectral analysis of unequally sampled signals.    Nc                    | j                   |j                   k7  rt        d      t        j                  |      }t        j                  |       }t        j                  |       }t	        |j                   d         D ]r  }d}d}d}	d}
d}t        j
                  ||   | z        |dd t        j                  ||   | z        |dd t	        | j                   d         D ]H  }|||   ||   z  z  }|||   ||   z  z  }|	||   ||   z  z  }	|
||   ||   z  z  }
|||   ||   z  z  }J ||   dk(  r
t               t        j                  d|z  |	|
z
        d||   z  z  }t        j
                  ||   |z        }t        j                  ||   |z        }||z  }||z  }d|z  |z  }d||z  ||z  z   dz  ||	z  ||z  z   ||
z  z   z  ||z  ||z  z
  dz  ||
z  ||z  z
  ||	z  z   z  z   z  ||<   u |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_taus                      8/usr/lib/python3/dist-packages/scipy/signal/_spectral.py_lombscargler"   	   sG   @ 	ww!''BCC MM% E
aA
aA5;;q>" 9vveAhl#!vveAhl#!qwwqz" 	A!A$1+B!A$1+B!A$1+B!A$1+B!A$1+B	 8q=#%%jjRb)Qq\:uQx#~&uQx#~&UU"EBJ3a7b[6B;&"46bj52:%)rkFRK'&2+578 9a99B L    )__doc__numpyr   r"    r#   r!   <module>r'      s    @ Jr#   