def get_frequency_grid(times,<EOL>samplesperpeak=<NUM_LIT:5>,<EOL>nyquistfactor=<NUM_LIT:5>,<EOL>minfreq=None,<EOL>maxfreq=None,<EOL>returnf0dfnf=False):
baseline = times.max() - times.min()<EOL>nsamples = times.size<EOL>df = <NUM_LIT:1.> / baseline / samplesperpeak<EOL>if minfreq is not None:<EOL><INDENT>f0 = minfreq<EOL><DEDENT>else:<EOL><INDENT>f0 = <NUM_LIT:0.5> * df<EOL><DEDENT>if maxfreq is not None:<EOL><INDENT>Nf = int(np.ceil((maxfreq - f0) / df))<EOL><DEDENT>else:<EOL><INDENT>Nf = int(<NUM_LIT:0.5> * samplesperpeak * nyquistfactor * nsamples)<EOL><DEDENT>if returnf0dfnf:<EOL><INDENT>return f0, df, Nf, f0 + df * np.arange(Nf)<EOL><DEDENT>else:<EOL><INDENT>return f0 + df * np.arange(Nf)<EOL><DEDENT>
This calculates a frequency grid for the period finding functions in this
    module.

    Based on the autofrequency function in astropy.stats.lombscargle.

    http://docs.astropy.org/en/stable/_modules/astropy/stats/lombscargle/core.html#LombScargle.autofrequency

    Parameters
    ----------

    times : np.array
        The times to use to generate the frequency grid over.

    samplesperpeak : int
        The minimum sample coverage each frequency point in the grid will get.

    nyquistfactor : int
        The multiplier over the Nyquist rate to use.

    minfreq,maxfreq : float or None
        If not None, these will be the limits of the frequency grid generated.

    returnf0dfnf : bool
        If this is True, will return the values of `f0`, `df`, and `Nf`
        generated for this grid.

    Returns
    -------

    np.array
        A grid of frequencies.