def parallel_periodicfeatures(pfpkl_list,<EOL>lcbasedir,<EOL>outdir,<EOL>starfeaturesdir=None,<EOL>fourierorder=<NUM_LIT:5>,<EOL>transitparams=(-<NUM_LIT>,<NUM_LIT:0.1>,<NUM_LIT:0.1>),<EOL>ebparams=(-<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT:0.5>),<EOL>pdiff_threshold=<NUM_LIT>,<EOL>sidereal_threshold=<NUM_LIT>,<EOL>sampling_peak_multiplier=<NUM_LIT>,<EOL>sampling_startp=None,<EOL>sampling_endp=None,<EOL>timecols=None,<EOL>magcols=None,<EOL>errcols=None,<EOL>lcformat='<STR_LIT>',<EOL>lcformatdir=None,<EOL>sigclip=<NUM_LIT>,<EOL>verbose=False,<EOL>maxobjects=None,<EOL>nworkers=NCPUS):
<EOL>if not os.path.exists(outdir):<EOL><INDENT>os.makedirs(outdir)<EOL><DEDENT>if maxobjects:<EOL><INDENT>pfpkl_list = pfpkl_list[:maxobjects]<EOL><DEDENT>LOGINFO('<STR_LIT>' % len(pfpkl_list))<EOL>if starfeaturesdir and os.path.exists(starfeaturesdir):<EOL><INDENT>starfeatures_list = []<EOL>LOGINFO('<STR_LIT>')<EOL>for pfpkl in pfpkl_list:<EOL><INDENT>sfpkl1 = os.path.basename(pfpkl).replace('<STR_LIT>',<EOL>'<STR_LIT>')<EOL>sfpkl2 = sfpkl1.replace('<STR_LIT>','<STR_LIT>')<EOL>sfpath1 = os.path.join(starfeaturesdir, sfpkl1)<EOL>sfpath2 = os.path.join(starfeaturesdir, sfpkl2)<EOL>if os.path.exists(sfpath1):<EOL><INDENT>starfeatures_list.append(sfpkl1)<EOL><DEDENT>elif os.path.exists(sfpath2):<EOL><INDENT>starfeatures_list.append(sfpkl2)<EOL><DEDENT>else:<EOL><INDENT>starfeatures_list.append(None)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>starfeatures_list = [None for x in pfpkl_list]<EOL><DEDENT>kwargs = {'<STR_LIT>':fourierorder,<EOL>'<STR_LIT>':transitparams,<EOL>'<STR_LIT>':ebparams,<EOL>'<STR_LIT>':pdiff_threshold,<EOL>'<STR_LIT>':sidereal_threshold,<EOL>'<STR_LIT>':sampling_peak_multiplier,<EOL>'<STR_LIT>':sampling_startp,<EOL>'<STR_LIT>':sampling_endp,<EOL>'<STR_LIT>':timecols,<EOL>'<STR_LIT>':magcols,<EOL>'<STR_LIT>':errcols,<EOL>'<STR_LIT>':lcformat,<EOL>'<STR_LIT>':lcformat,<EOL>'<STR_LIT>':sigclip,<EOL>'<STR_LIT>':verbose}<EOL>tasks = [(x, lcbasedir, outdir, y, kwargs) for (x,y) in<EOL>zip(pfpkl_list, starfeatures_list)]<EOL>LOGINFO('<STR_LIT>')<EOL>with ProcessPoolExecutor(max_workers=nworkers) as executor:<EOL><INDENT>resultfutures = executor.map(_periodicfeatures_worker, tasks)<EOL><DEDENT>results = [x for x in resultfutures]<EOL>resdict = {os.path.basename(x):y for (x,y) in zip(pfpkl_list, results)}<EOL>return resdict<EOL>
This runs periodic feature generation in parallel for all periodfinding
    pickles in the input list.

    Parameters
    ----------

    pfpkl_list : list of str
        The list of period-finding pickles to use.

    lcbasedir : str
        The base directory where the associated light curves are located.

    outdir : str
        The directory where the results will be written.

    starfeaturesdir : str or None
        The directory containing the `starfeatures-<objectid>.pkl` files for
        each object to use calculate neighbor proximity light curve features.

    fourierorder : int
        The Fourier order to use to generate sinusoidal function and fit that to
        the phased light curve.

    transitparams : list of floats
        The transit depth, duration, and ingress duration to use to generate a
        trapezoid planet transit model fit to the phased light curve. The period
        used is the one provided in `period`, while the epoch is automatically
        obtained from a spline fit to the phased light curve.

    ebparams : list of floats
        The primary eclipse depth, eclipse duration, the primary-secondary depth
        ratio, and the phase of the secondary eclipse to use to generate an
        eclipsing binary model fit to the phased light curve. The period used is
        the one provided in `period`, while the epoch is automatically obtained
        from a spline fit to the phased light curve.

    pdiff_threshold : float
        This is the max difference between periods to consider them the same.

    sidereal_threshold : float
        This is the max difference between any of the 'best' periods and the
        sidereal day periods to consider them the same.

    sampling_peak_multiplier : float
        This is the minimum multiplicative factor of a 'best' period's
        normalized periodogram peak over the sampling periodogram peak at the
        same period required to accept the 'best' period as possibly real.

    sampling_startp, sampling_endp : float
        If the `pgramlist` doesn't have a time-sampling Lomb-Scargle
        periodogram, it will be obtained automatically. Use these kwargs to
        control the minimum and maximum period interval to be searched when
        generating this periodogram.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    verbose : bool
        If True, will indicate progress while working.

    maxobjects : int
        The total number of objects to process from `pfpkl_list`.

    nworkers : int
        The number of parallel workers to launch to process the input.

    Returns
    -------

    dict
        A dict containing key: val pairs of the input period-finder result and
        the output periodic feature result pickles for each input pickle is
        returned.