def lightcurve_ptp_measures(ftimes, fmags, ferrs):
ndet = len(fmags)<EOL>if ndet > <NUM_LIT:9>:<EOL><INDENT>timediffs = npdiff(ftimes)<EOL>nzind = npnonzero(timediffs)<EOL>ftimes, fmags, ferrs = ftimes[nzind], fmags[nzind], ferrs[nzind]<EOL>ndet = ftimes.size<EOL>timediffs = npdiff(ftimes)<EOL>p2p_abs_magdiffs = npabs(npdiff(fmags))<EOL>p2p_squared_magdiffs = npdiff(fmags)*npdiff(fmags)<EOL>robstd = npmedian(npabs(fmags - npmedian(fmags)))*<NUM_LIT><EOL>robvar = robstd*robstd<EOL>eta_robust = npmedian(p2p_abs_magdiffs)/robvar<EOL>eta_robust = eta_robust/(ndet - <NUM_LIT:1.0>)<EOL>eta_normal = npsum(p2p_squared_magdiffs)/npvar(fmags)<EOL>eta_normal = eta_normal/(ndet - <NUM_LIT:1.0>)<EOL>timeweights = <NUM_LIT:1.0>/(timediffs*timediffs)<EOL>eta_uneven_normal = (<EOL>(npsum(timeweights*p2p_squared_magdiffs) /<EOL>(npvar(fmags) * npsum(timeweights)) ) *<EOL>npmean(timeweights) *<EOL>(ftimes.max() - ftimes.min())*(ftimes.max() - ftimes.min())<EOL>)<EOL>eta_uneven_robust = (<EOL>(npsum(timeweights*p2p_abs_magdiffs) /<EOL>(robvar * npsum(timeweights)) ) *<EOL>npmedian(timeweights) *<EOL>(ftimes[-<NUM_LIT:1>] - ftimes[<NUM_LIT:0>])*(ftimes[-<NUM_LIT:1>] - ftimes[<NUM_LIT:0>])<EOL>)<EOL>return {<EOL>'<STR_LIT>':eta_normal,<EOL>'<STR_LIT>':eta_robust,<EOL>'<STR_LIT>':eta_uneven_normal,<EOL>'<STR_LIT>':eta_uneven_robust<EOL>}<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
This calculates various point-to-point measures (`eta` in Kim+ 2014).

    Parameters
    ----------

    ftimes,fmags,ferrs : np.array
        The input mag/flux time-series with all non-finite elements removed.

    Returns
    -------

    dict
        A dict with values of the point-to-point measures, including the `eta`
        variability index (often used as its inverse `inveta` to have the same
        sense as increasing variability index -> more likely a variable star).