Module Import alias Import alias ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Assign NameStore Call NameLoad ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num Num body If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr BinOpMult Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpOr CompareNotEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr CompareNotEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr CompareNotEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Num If CompareLt Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad Call AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr orelse If CompareLtE NameLoad Num body Assign AttributeStore NameLoad attr Num orelse Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareLtE NameLoad Num body Assign AttributeStore NameLoad attr Num orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr BinOpMult BinOpPow BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr BinOpSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Call NameLoad BinOpMult BinOpDiv BinOpDiv BinOpSub Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad NameLoad Num If CompareLt NameLoad Num body Assign NameStore Num Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr BinOpDiv Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr BinOpDiv BinOpSub SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpMult NameLoad Num Num Assign NameStore BinOpDiv BinOpMod NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad keyword TupleLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd BinOpPow SubscriptLoad NameLoad Index Num Num BinOpPow SubscriptLoad NameLoad Index Num Num Assign AttributeStore NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr BinOpAdd BinOpPow SubscriptLoad NameLoad Index Num Num BinOpPow SubscriptLoad NameLoad Index Num Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr BinOpAdd BinOpPow SubscriptLoad NameLoad Index Num Num BinOpPow SubscriptLoad NameLoad Index Num Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpDiv UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr BinOpSub Call AttributeLoad NameLoad attr BinOpDiv UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpMult Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpSub Call AttributeLoad NameLoad attr BinOpDiv UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpMult Num AttributeLoad NameLoad attr Expr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad If CompareLt NameLoad Num body Assign NameStore Num If CompareGt NameLoad BinOpSub Call NameLoad NameLoad Num body Assign NameStore BinOpSub Call NameLoad NameLoad Num Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLtE NameLoad BinOpAdd NameLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index CompareLt NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore Num orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index CompareGt NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore BinOpSub Call NameLoad NameLoad Num orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore BinOpDiv BinOpSub BinOpDiv Num SubscriptLoad NameLoad Index NameLoad BinOpDiv Num SubscriptLoad NameLoad Index NameLoad Num Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Return BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad NameLoad Index Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore BinOpAdd BinOpMult SubscriptLoad NameLoad Index BinOpAdd BinOpMult NameLoad Num Num Call AttributeLoad NameLoad attr BinOpMult BinOpMult BinOpMult Num AttributeLoad NameLoad attr BinOpAdd NameLoad Num NameLoad BinOpMult SubscriptLoad NameLoad Index BinOpAdd BinOpMult NameLoad Num Num Call AttributeLoad NameLoad attr BinOpMult BinOpMult BinOpMult Num AttributeLoad NameLoad attr BinOpAdd NameLoad Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpDiv Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr CompareGt NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpMult BinOpPow BinOpSub NameLoad NameLoad Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr CompareLtE NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpMult BinOpPow BinOpSub NameLoad NameLoad Num NameLoad NameLoad Return Call AttributeLoad NameLoad attr BinOpDiv NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr CompareGt NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr CompareLtE NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr BinOpDiv NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice BinOpSub Call NameLoad NameLoad Num Assign NameStore BinOpDiv BinOpDiv BinOpDiv Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad BinOpSub Call NameLoad NameLoad Num NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice BinOpSub Call NameLoad NameLoad Num Assign NameStore BinOpSub SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice BinOpSub Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr CompareNotEq NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpDiv BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr Return BinOpSub Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Call NameLoad NameLoad For NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str body If UnaryOpNot BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Str Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call NameLoad NameLoad For NameStore Call AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Return NameLoad decorator_list decorator_list
N/A N/A warnings N/A multiprocessing collections OrderedDict N/A numpy np N/A scipy.stats ss scipy.optimize leastsq N/A period_LS_pyfftw pLS feature_set get_feature_set feature_set get_feature_set_all N/A feature_names_list N/A get_feature_set N/A feature_names_list_all N/A get_feature_set_all ExtractFeatures N/A N/A N/A 
    Extract variability features of a light curve.

    Parameters
    ----------
    date : array_like
        An array of observed date, in days.
    mag : array_like
        An array of observed magnitude.
    err : array_like, optional
        An array of magnitude error. If None, std(mag) will be used.
    n_threads : int, optional
        The number of cores to use to derive periods.
    min_period : float, optional
        The minimum period to calculate.
     __init__ N/A N/A self date mag err n_threads min_period N/A None 4 0.03 N/A N/A N/A N/A isinstance date N/A np ndarray N/A N/A date N/A N/A np array date N/A N/A N/A isinstance mag N/A np ndarray N/A N/A mag N/A N/A np array mag N/A N/A self date date N/A N/A self mag mag N/A N/A err None N/A N/A N/A N/A isinstance err N/A np ndarray N/A N/A err N/A N/A np array err N/A N/A self err err N/A N/A N/A self err N/A N/A N/A np ones N/A len N/A self mag N/A N/A np std N/A self mag N/A N/A N/A N/A len N/A self date N/A len N/A self mag N/A N/A len N/A self date N/A len N/A self err N/A N/A len N/A self mag N/A len N/A self err N/A N/A N/A RuntimeError The length of date, mag, and err must be same. N/A min_n_data 80 N/A N/A N/A len N/A self date min_n_data N/A N/A N/A N/A warnings warn N/A The number of data points are less than %d. min_n_data N/A n_threads N/A int n_threads N/A N/A n_threads N/A N/A multiprocessing cpu_count N/A N/A N/A self n_threads N/A N/A multiprocessing cpu_count N/A N/A N/A n_threads 0 N/A N/A N/A self n_threads 1 N/A N/A N/A self n_threads n_threads N/A min_period N/A float min_period N/A N/A min_period 0 N/A N/A N/A self min_period 0.03 N/A N/A N/A self min_period min_period N/A run N/A N/A self N/A N/A N/A Run feature extraction modules. N/A N/A N/A self shallow_run N/A N/A N/A self deep_run N/A shallow_run N/A N/A self N/A N/A N/A Derive not-period-based features. N/A N/A self n_points N/A len N/A self date N/A N/A self weight N/A 1.0 N/A self err N/A N/A self weighted_sum N/A N/A np sum N/A self weight N/A N/A self mean N/A N/A np mean N/A self mag N/A N/A self median N/A N/A np median N/A self mag N/A N/A self std N/A N/A np std N/A self mag N/A N/A self weighted_mean N/A N/A N/A np sum N/A N/A self mag N/A self weight N/A self weighted_sum N/A N/A self weighted_std N/A N/A np sqrt N/A N/A N/A np sum N/A N/A N/A N/A self mag N/A self weighted_mean 2 N/A self weight N/A self weighted_sum N/A N/A self skewness N/A N/A ss skew N/A self mag N/A N/A self kurtosis N/A N/A ss kurtosis N/A self mag N/A shapiro N/A N/A ss shapiro N/A self mag N/A N/A self shapiro_w N/A shapiro N/A 0 N/A N/A self quartile31 N/A N/A N/A np percentile N/A self mag 75 N/A N/A np percentile N/A self mag 25 N/A N/A self stetson_k N/A N/A self get_stetson_k N/A self mag N/A self median N/A self err N/A N/A self hl_amp_ratio N/A N/A self half_mag_amplitude_ratio N/A self mag N/A self median N/A self weight N/A N/A self cusum N/A N/A self get_cusum N/A self mag N/A N/A self eta N/A N/A self get_eta N/A self mag N/A self weighted_std N/A deep_run N/A N/A self N/A N/A N/A Derive period-based features. N/A N/A N/A self get_period_LS N/A self date N/A self mag N/A self n_threads N/A self min_period N/A phase_folded_date N/A N/A self date N/A N/A self period 2.0 N/A sorted_index N/A N/A np argsort phase_folded_date N/A folded_date N/A phase_folded_date N/A sorted_index N/A folded_mag N/A N/A self mag N/A sorted_index N/A N/A self phase_eta N/A N/A self get_eta folded_mag N/A self weighted_std N/A N/A N/A self slope_per10 N/A self slope_per90 N/A N/A self slope_percentile folded_date folded_mag N/A N/A self phase_cusum N/A N/A self get_cusum folded_mag N/A get_period_LS N/A N/A self date mag n_threads min_period N/A N/A N/A 
        Period finding using the Lomb-Scargle algorithm.

        Finding two periods. The second period is estimated after whitening
        the first period. Calculating various other features as well
        using derived periods.

        Parameters
        ----------
        date : array_like
            An array of observed date, in days.
        mag : array_like
            An array of observed magnitude.
        n_threads : int
            The number of threads to use.
        min_period : float
            The minimum period to calculate.
         N/A oversampling 3.0 N/A hifac N/A int N/A N/A N/A N/A N/A max date N/A min date N/A len date min_period 2.0 N/A N/A hifac 100 N/A N/A hifac 100 N/A N/A fx fy nout jmax prob N/A N/A pLS fasper date mag oversampling hifac n_threads N/A N/A self f N/A fx N/A jmax N/A N/A self period N/A 1.0 N/A self f N/A N/A self period_uncertainty N/A N/A self get_period_uncertainty fx fy jmax N/A N/A self period_log10FAP N/A N/A np log10 N/A N/A N/A pLS getSignificance fx fy nout oversampling N/A jmax N/A N/A self period_SNR N/A N/A N/A fy N/A jmax N/A N/A np median fy N/A N/A np std fy N/A order 3 N/A p0 N/A N/A np ones N/A N/A order 2 1 N/A date_period N/A N/A date N/A self period N/A self period N/A N/A p1 success N/A leastsq N/A self residuals p0 args N/A date_period mag order N/A N/A self amplitude N/A N/A np sqrt N/A N/A N/A p1 N/A 1 2 N/A N/A p1 N/A 2 2 N/A N/A self r21 N/A N/A N/A np sqrt N/A N/A N/A p1 N/A 3 2 N/A N/A p1 N/A 4 2 N/A self amplitude N/A N/A self r31 N/A N/A N/A np sqrt N/A N/A N/A p1 N/A 5 2 N/A N/A p1 N/A 6 2 N/A self amplitude N/A N/A self f_phase N/A N/A np arctan N/A N/A N/A p1 N/A 1 N/A p1 N/A 2 N/A N/A self phi21 N/A N/A N/A np arctan N/A N/A N/A p1 N/A 3 N/A p1 N/A 4 N/A 2.0 N/A self f_phase N/A N/A self phi31 N/A N/A N/A np arctan N/A N/A N/A p1 N/A 5 N/A p1 N/A 6 N/A 3.0 N/A self f_phase N/A 
        # Derive a second period.
        # Whitening a light curve.
        residual_mag = mag - fitted_y

        # Lomb-Scargle again to find the second period.
        omega_top, power_top = search_frequencies(date, residual_mag, err,
            #LS_kwargs={'generalized':True, 'subtract_mean':True},
            n_eval=5000, n_retry=3, n_save=50)

        self.period2 = 2*np.pi/omega_top[np.where(power_top==np.max(power_top))][0]
        self.f2 = 1. / self.period2
        self.f2_SNR = power_top[np.where(power_top==np.max(power_top))][0]             * (len(self.date) - 1) / 2.

        # Fit Fourier Series again.
        p0 = [1.] * order * 2
        date_period = (date % self.period) / self.period
        p2, success = leastsq(self.residuals, p0,
            args=(date_period, residual_mag, order))
        fitted_y = self.FourierSeries(p2, date_period, order)

        #plt.plot(date%self.period2, residual_mag, 'b+')
        #plt.show()

        # Derive Fourier features for the first second.
        self.f2_amp = 2. * np.sqrt(p2[1]**2 + p2[2]**2)
        self.f2_R21 = np.sqrt(p2[3]**2 + p2[4]**2) / self.f2_amp
        self.f2_R31 = np.sqrt(p2[5]**2 + p2[6]**2) / self.f2_amp
        self.f2_R41 = np.sqrt(p2[7]**2 + p2[8]**2) / self.f2_amp
        self.f2_R51 = np.sqrt(p2[9]**2 + p2[10]**2) / self.f2_amp
        self.f2_phase = np.arctan(-p2[1] / p2[2])
        self.f2_phi21 = np.arctan(-p2[3] / p2[4]) - 2. * self.f2_phase
        self.f2_phi31 = np.arctan(-p2[5] / p2[6]) - 3. * self.f2_phase
        self.f2_phi41 = np.arctan(-p2[7] / p2[8]) - 4. * self.f2_phase
        self.f2_phi51 = np.arctan(-p2[9] / p2[10]) - 5. * self.f2_phase

        # Calculate features using the first and second periods.
        self.f12_ratio = self.f2 / self.f1
        self.f12_remain = self.f1 % self.f2             if self.f1 > self.f2 else self.f2 % self.f1
        self.f12_amp = self.f2_amp / self.f1_amp
        self.f12_phase = self.f2_phase - self.f1_phase
         N/A get_period_uncertainty N/A N/A self fx fy jmax fx_width N/A 100 N/A N/A 
        Get uncertainty of a period.

        The uncertainty is defined as the half width of the frequencies
        around the peak, that becomes lower than average + standard deviation
        of the power spectrum.

        Since we may not have fine resolution around the peak,
        we do not assume it is gaussian. So, no scaling factor of
        2.355 (= 2 * sqrt(2 * ln2)) is applied.

        Parameters
        ----------
        fx : array_like
            An array of frequencies.
        fy : array_like
            An array of amplitudes.
        jmax : int
            An index at the peak frequency.
        fx_width : int, optional
            Width of power spectrum to calculate uncertainty.

        Returns
        -------
        p_uncertain : float
            Period uncertainty.
         N/A start_index N/A jmax fx_width N/A end_index N/A jmax fx_width N/A N/A start_index 0 N/A N/A start_index 0 N/A N/A end_index N/A N/A len fx 1 N/A N/A end_index N/A N/A len fx 1 N/A fx_subset N/A fx N/A start_index end_index N/A fy_subset N/A fy N/A start_index end_index N/A fy_mean N/A N/A np median fy_subset N/A fy_std N/A N/A np std fy_subset N/A max_index N/A N/A np argmax fy_subset N/A index N/A N/A N/A np where N/A fy_subset N/A fy_mean fy_std N/A 0 N/A left_index N/A index N/A N/A index max_index N/A N/A N/A len left_index 0 N/A N/A left_index 0 N/A N/A left_index N/A left_index N/A -1 N/A right_index N/A index N/A N/A index max_index N/A N/A N/A len right_index 0 N/A N/A right_index N/A N/A len fy_subset 1 N/A N/A right_index N/A right_index N/A 0 N/A half_width N/A N/A N/A 1.0 N/A fx_subset N/A left_index N/A 1.0 N/A fx_subset N/A right_index 2.0 N/A period_uncertainty half_width N/A period_uncertainty N/A residuals N/A N/A self pars x y order N/A N/A N/A 
        Residual of Fourier Series.

        Parameters
        ----------
        pars : array_like
            Fourier series parameters.
        x : array_like
            An array of date.
        y : array_like
            An array of true values to fit.
        order : int
            An order of Fourier Series.
         N/A N/A y N/A N/A self fourier_series pars x order N/A fourier_series N/A N/A self pars x order N/A N/A N/A 
        Function to fit Fourier Series.

        Parameters
        ----------
        x : array_like
            An array of date divided by period. It doesn't need to be sorted.
        pars :  array_like
            Fourier series parameters.
        order : int
            An order of Fourier series.
         N/A sum N/A pars N/A 0 N/A i N/A range order N/A N/A sum N/A N/A N/A pars N/A N/A N/A i 2 1 N/A N/A np sin N/A N/A N/A 2 N/A np pi N/A i 1 x N/A N/A pars N/A N/A N/A i 2 2 N/A N/A np cos N/A N/A N/A 2 N/A np pi N/A i 1 x N/A sum N/A get_stetson_k N/A N/A self mag avg err N/A N/A N/A 
        Return Stetson K feature.

        Parameters
        ----------
        mag : array_like
            An array of magnitude.
        avg : float
            An average value of magnitudes.
        err : array_like
            An array of magnitude errors.

        Returns
        -------
        stetson_k : float
            Stetson K value.
         N/A residual N/A N/A mag avg err N/A stetson_k N/A N/A N/A N/A np sum N/A N/A np fabs residual N/A N/A np sqrt N/A N/A np sum N/A residual residual N/A N/A np sqrt N/A len mag N/A stetson_k N/A half_mag_amplitude_ratio N/A N/A self mag avg weight N/A N/A N/A 
        Return ratio of amplitude of higher and lower magnitudes.


        A ratio of amplitude of higher and lower magnitudes than average,
        considering weights. This ratio, by definition, should be higher
        for EB than for others.

        Parameters
        ----------
        mag : array_like
            An array of magnitudes.
        avg : float
            An average value of magnitudes.
        weight : array_like
            An array of weight.

        Returns
        -------
        hl_ratio : float
            Ratio of amplitude of higher and lower magnitudes than average.
         N/A index N/A N/A np where N/A mag avg N/A lower_weight N/A weight N/A index N/A lower_weight_sum N/A N/A np sum lower_weight N/A lower_mag N/A mag N/A index N/A lower_weighted_std N/A N/A N/A np sum N/A N/A N/A lower_mag avg 2 lower_weight lower_weight_sum N/A index N/A N/A np where N/A mag avg N/A higher_weight N/A weight N/A index N/A higher_weight_sum N/A N/A np sum higher_weight N/A higher_mag N/A mag N/A index N/A higher_weighted_std N/A N/A N/A np sum N/A N/A N/A higher_mag avg 2 higher_weight higher_weight_sum N/A N/A N/A np sqrt N/A lower_weighted_std higher_weighted_std N/A half_mag_amplitude_ratio2 N/A N/A self mag avg N/A N/A N/A 
        Return ratio of amplitude of higher and lower magnitudes.


        A ratio of amplitude of higher and lower magnitudes than average,
        considering weights. This ratio, by definition, should be higher
        for EB than for others.

        Parameters
        ----------
        mag : array_like
            An array of magnitudes.
        avg : float
            An average value of magnitudes.

        Returns
        -------
        hl_ratio : float
            Ratio of amplitude of higher and lower magnitudes than average.
         N/A index N/A N/A np where N/A mag avg N/A fainter_mag N/A mag N/A index N/A lower_sum N/A N/A N/A np sum N/A N/A fainter_mag avg 2 N/A len fainter_mag N/A index N/A N/A np where N/A mag avg N/A brighter_mag N/A mag N/A index N/A higher_sum N/A N/A N/A np sum N/A N/A avg brighter_mag 2 N/A len brighter_mag N/A N/A N/A np sqrt N/A lower_sum higher_sum N/A get_eta N/A N/A self mag std N/A N/A N/A 
        Return Eta feature.

        Parameters
        ----------
        mag : array_like
            An array of magnitudes.
        std : array_like
            A standard deviation of magnitudes.

        Returns
        -------
        eta : float
            The value of Eta index.
         N/A diff N/A N/A mag N/A 1 N/A mag N/A N/A N/A len mag 1 N/A eta N/A N/A N/A N/A N/A np sum N/A diff diff N/A N/A len mag 1.0 std std N/A eta N/A slope_percentile N/A N/A self date mag N/A N/A N/A 
        Return 10% and 90% percentile of slope.

        Parameters
        ----------
        date : array_like
            An array of phase-folded date. Sorted.
        mag : array_like
            An array of phase-folded magnitudes. Sorted by date.

        Returns
        -------
        per_10 : float
            10% percentile values of slope.
        per_90 : float
            90% percentile values of slope.
         N/A date_diff N/A N/A date N/A 1 N/A date N/A N/A N/A len date 1 N/A mag_diff N/A N/A mag N/A 1 N/A mag N/A N/A N/A len mag 1 N/A index N/A N/A np where N/A mag_diff 0.0 N/A date_diff N/A date_diff N/A index N/A mag_diff N/A mag_diff N/A index N/A slope N/A date_diff mag_diff N/A percentile_10 N/A N/A np percentile slope 10.0 N/A percentile_90 N/A N/A np percentile slope 90.0 N/A N/A percentile_10 percentile_90 N/A get_cusum N/A N/A self mag N/A N/A N/A 
        Return max - min of cumulative sum.

        Parameters
        ----------
        mag : array_like
            An array of magnitudes.

        Returns
        -------
        mm_cusum : float
            Max - min of cumulative sum.
         N/A c N/A N/A N/A N/A np cumsum N/A mag N/A self weighted_mean N/A len mag N/A self weighted_std N/A N/A N/A N/A np max c N/A N/A np min c N/A get_features2 N/A N/A self N/A N/A N/A 
        Return all features with its names.

        Returns
        -------
        names : list
            Feature names.
        values : list
            Feature values
         N/A feature_names N/A N/A feature_values N/A N/A all_vars N/A vars self N/A name N/A N/A all_vars keys N/A N/A N/A N/A N/A name date N/A name mag N/A name err N/A name n_threads N/A name min_period N/A N/A N/A N/A N/A name f N/A name f_phase N/A name period_log10FAP N/A name weight N/A name weighted_sum N/A name median N/A name mean N/A name std N/A N/A N/A N/A feature_names append name N/A N/A N/A feature_names sort N/A name feature_names N/A N/A N/A N/A feature_values append N/A all_vars N/A name N/A N/A feature_names feature_values N/A get_features N/A N/A self N/A N/A N/A 
        Return all features with its names.

        Regardless of being used for train and prediction. Sorted by the names.

        Returns
        -------
        all_features : OrderedDict
            Features dictionary.
         N/A 
        features = {}

        # Get all the names of features.
        all_vars = vars(self)
        for name in all_vars.keys():
            if name in feature_names_list:
                features[name] = all_vars[name]

        # Sort by the keys (i.e. feature names).
        features = OrderedDict(sorted(features.items(), key=lambda t: t[0]))

        return features
         N/A N/A N/A self get_features_all N/A get_features_all N/A N/A self N/A N/A N/A 
        Return all features with its names.

        Regardless of being used for train and prediction. Sorted by the names.

        Returns
        -------
        all_features : OrderedDict
            Features dictionary.
         N/A features N/A N/A all_vars N/A vars self N/A name N/A N/A all_vars keys N/A N/A N/A name feature_names_list_all N/A N/A N/A features N/A name N/A all_vars N/A name N/A features N/A OrderedDict N/A sorted N/A N/A features items key N/A N/A N/A t N/A N/A t N/A 0 N/A features N/A N/A