def generate_transit_lightcurve(<EOL>times,<EOL>mags=None,<EOL>errs=None,<EOL>paramdists={'<STR_LIT>':sps.uniform(loc=<NUM_LIT:0.1>,scale=<NUM_LIT>),<EOL>'<STR_LIT>':sps.uniform(loc=<NUM_LIT>,scale=<NUM_LIT>),<EOL>'<STR_LIT>':sps.uniform(loc=<NUM_LIT>,scale=<NUM_LIT>)},<EOL>magsarefluxes=False,<EOL>):
if mags is None:<EOL><INDENT>mags = np.full_like(times, <NUM_LIT:0.0>)<EOL><DEDENT>if errs is None:<EOL><INDENT>errs = np.full_like(times, <NUM_LIT:0.0>)<EOL><DEDENT>epoch = npr.random()*(times.max() - times.min()) + times.min()<EOL>period = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>depth = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>duration = paramdists['<STR_LIT>'].rvs(size=<NUM_LIT:1>)<EOL>ingduration = npr.random()*(<NUM_LIT:0.5>*duration - <NUM_LIT>*duration) + <NUM_LIT>*duration<EOL>if magsarefluxes and depth < <NUM_LIT:0.0>:<EOL><INDENT>depth = -depth<EOL><DEDENT>elif not magsarefluxes and depth > <NUM_LIT:0.0>:<EOL><INDENT>depth = -depth<EOL><DEDENT>modelmags, phase, ptimes, pmags, perrs = (<EOL>transits.trapezoid_transit_func([period, epoch, depth,<EOL>duration, ingduration],<EOL>times,<EOL>mags,<EOL>errs)<EOL>)<EOL>timeind = np.argsort(ptimes)<EOL>mtimes = ptimes[timeind]<EOL>mmags = modelmags[timeind]<EOL>merrs = perrs[timeind]<EOL>modeldict = {<EOL>'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':{x:np.asscalar(y) for x,y in zip(['<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'],<EOL>[period,<EOL>epoch,<EOL>depth,<EOL>duration,<EOL>ingduration])},<EOL>'<STR_LIT>':mtimes,<EOL>'<STR_LIT>':mmags,<EOL>'<STR_LIT>':merrs,<EOL>'<STR_LIT>':period,<EOL>'<STR_LIT>':depth<EOL>}<EOL>return modeldict<EOL>
This generates fake planet transit light curves.

    Parameters
    ----------

    times : np.array
        This is an array of time values that will be used as the time base.

    mags,errs : np.array
        These arrays will have the model added to them. If either is
        None, `np.full_like(times, 0.0)` will used as a substitute and the model
        light curve will be centered around 0.0.

    paramdists : dict
        This is a dict containing parameter distributions to use for the
        model params, containing the following keys ::

            {'transitperiod', 'transitdepth', 'transitduration'}

        The values of these keys should all be 'frozen' scipy.stats distribution
        objects, e.g.:

        https://docs.scipy.org/doc/scipy/reference/stats.html#continuous-distributions
        The variability epoch will be automatically chosen from a uniform
        distribution between `times.min()` and `times.max()`.

        The ingress duration will be automatically chosen from a uniform
        distribution ranging from 0.05 to 0.5 of the transitduration.

        The transitdepth will be flipped automatically as appropriate if
        `magsarefluxes=True`.

    magsarefluxes : bool
        If the generated time series is meant to be a flux time-series, set this
        to True to get the correct sign of variability amplitude.

    Returns
    -------

    dict
        A dict of the form below is returned::

            {'vartype': 'planet',
             'params': {'transitperiod': generated value of period,
                        'transitepoch': generated value of epoch,
                        'transitdepth': generated value of transit depth,
                        'transitduration': generated value of transit duration,
                        'ingressduration': generated value of transit ingress
                                           duration},
             'times': the model times,
             'mags': the model mags,
             'errs': the model errs,
             'varperiod': the generated period of variability == 'transitperiod'
             'varamplitude': the generated amplitude of
                             variability == 'transitdepth'}