def specwindow_lsp_value(times, mags, errs, omega):
norm_times = times - times.min()<EOL>tau = (<EOL>(<NUM_LIT:1.0>/(<NUM_LIT>*omega)) *<EOL>nparctan( npsum(npsin(<NUM_LIT>*omega*norm_times)) /<EOL>npsum(npcos(<NUM_LIT>*omega*norm_times)) )<EOL>)<EOL>lspval_top_cos = (npsum(<NUM_LIT:1.0> * npcos(omega*(norm_times-tau))) *<EOL>npsum(<NUM_LIT:1.0> * npcos(omega*(norm_times-tau))))<EOL>lspval_bot_cos = npsum( (npcos(omega*(norm_times-tau))) *<EOL>(npcos(omega*(norm_times-tau))) )<EOL>lspval_top_sin = (npsum(<NUM_LIT:1.0> * npsin(omega*(norm_times-tau))) *<EOL>npsum(<NUM_LIT:1.0> * npsin(omega*(norm_times-tau))))<EOL>lspval_bot_sin = npsum( (npsin(omega*(norm_times-tau))) *<EOL>(npsin(omega*(norm_times-tau))) )<EOL>lspval = <NUM_LIT:0.5> * ( (lspval_top_cos/lspval_bot_cos) +<EOL>(lspval_top_sin/lspval_bot_sin) )<EOL>return lspval<EOL>
This calculates the peak associated with the spectral window function
    for times and at the specified omega.

    NOTE: this is classical Lomb-Scargle, not the Generalized
    Lomb-Scargle. `mags` and `errs` are silently ignored since we're calculating
    the periodogram of the observing window function. These are kept to present
    a consistent external API so the `pgen_lsp` function below can call this
    transparently.

    Parameters
    ----------

    times,mags,errs : np.array
        The time-series to calculate the periodogram value for.

    omega : float
        The frequency to calculate the periodogram value at.

    Returns
    -------

    periodogramvalue : float
        The normalized periodogram at the specified test frequency `omega`.