def lightcurve_moments(ftimes, fmags, ferrs):
ndet = len(fmags)<EOL>if ndet > <NUM_LIT:9>:<EOL><INDENT>series_median = npmedian(fmags)<EOL>series_wmean = (<EOL>npsum(fmags*(<NUM_LIT:1.0>/(ferrs*ferrs)))/npsum(<NUM_LIT:1.0>/(ferrs*ferrs))<EOL>)<EOL>series_mad = npmedian(npabs(fmags - series_median))<EOL>series_stdev = <NUM_LIT>*series_mad<EOL>series_skew = spskew(fmags)<EOL>series_kurtosis = spkurtosis(fmags)<EOL>series_above1std = len(fmags[fmags > (series_median + series_stdev)])<EOL>series_below1std = len(fmags[fmags < (series_median - series_stdev)])<EOL>series_beyond1std = (series_above1std + series_below1std)/float(ndet)<EOL>series_mag_percentiles = nppercentile(<EOL>fmags,<EOL>[<NUM_LIT>,<NUM_LIT:10>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>]<EOL>)<EOL>return {<EOL>'<STR_LIT>':series_median,<EOL>'<STR_LIT>':series_wmean,<EOL>'<STR_LIT>':series_mad,<EOL>'<STR_LIT>':series_stdev,<EOL>'<STR_LIT>':series_skew,<EOL>'<STR_LIT>':series_kurtosis,<EOL>'<STR_LIT>':series_beyond1std,<EOL>'<STR_LIT>':series_mag_percentiles,<EOL>'<STR_LIT>': series_mag_percentiles[<NUM_LIT:8>] - series_mag_percentiles[<NUM_LIT:3>],<EOL>}<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return None<EOL><DEDENT>
This calculates the weighted mean, stdev, median, MAD, percentiles, skew,
    kurtosis, fraction of LC beyond 1-stdev, and IQR.

    Parameters
    ----------

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

    Returns
    -------

    dict
        A dict with all of the light curve moments calculated.