def __init__(self, date, mag, err=None, n_threads=4, min_period=0.03):
        # Set basic values.
        if not isinstance(date, np.ndarray):
            date = np.array(date)
        if not isinstance(mag, np.ndarray):
            mag = np.array(mag)

        self.date = date
        self.mag = mag
        if err is not None:
            if not isinstance(err, np.ndarray):
                err = np.array(err)
            self.err = err
        else:
            self.err = np.ones(len(self.mag)) * np.std(self.mag)

        # Check length.
        if (len(self.date) != len(self.mag)) or \
           (len(self.date) != len(self.err)) or \
           (len(self.mag) != len(self.err)):
            raise RuntimeError('The length of date, mag, and err must be same.')

        # if the number of data points is too small.
        min_n_data = 80
        if len(self.date) < min_n_data:
            warnings.warn('The number of data points are less than %d.'
                          % min_n_data)

        n_threads = int(n_threads)
        if n_threads > multiprocessing.cpu_count():
            self.n_threads = multiprocessing.cpu_count()
        else:
            if n_threads <= 0:
                self.n_threads = 1
            else:
                self.n_threads = n_threads

        min_period = float(min_period)
        if min_period <= 0:
            self.min_period = 0.03
        else:
            self.min_period = min_period
dataset/ETHPy150Open dwkim78/upsilon/upsilon/extract_features/extract_features.py/ExtractFeatures.__init__/original