# Path: thejoker/logging.py
# class JokerHandler(StreamHandler):
# class JokerLogger(logging.getLoggerClass()):
#     def emit(self, record):
#     def _set_defaults(self):
# 
# Path: thejoker/data_helpers.py
# def guess_time_format(time_val):
#     """Guess the `astropy.time.Time` format from the input value(s).
# 
#     Parameters
#     ----------
#     time_val : float, array_like
#         The value or values to guess the format from.
# 
#     Returns
#     -------
#     format : str
#         The `astropy.time.Time` format string, guessed from the value.
# 
#     """
#     arr = np.array(time_val)
# 
#     # Only support float or int times
#     if arr.dtype.char not in ['f', 'd', 'i', 'l']:
#         raise NotImplementedError("We can only try to guess "
#                                   "the time format with a numeric "
#                                   "time value. Sorry about that!")
# 
#     # HACK: magic number!
#     dt_thresh = 50*u.year
# 
#     jd_check = np.abs(arr - Time('2010-01-01').jd) * u.day < dt_thresh
#     jd_check = np.all(jd_check)
# 
#     mjd_check = np.abs(arr - Time('2010-01-01').mjd) * u.day < dt_thresh
#     mjd_check = np.all(mjd_check)
# 
#     err_msg = ("Unable to guess time format! Initialize with an "
#                "explicit astropy.time.Time() object instead.")
#     if jd_check and mjd_check:
#         raise ValueError(err_msg)
# 
#     elif jd_check:
#         return 'jd'
# 
#     elif mjd_check:
#         return 'mjd'
# 
#     else:
#         raise ValueError(err_msg)
# 
# Path: thejoker/exceptions.py
# class TheJokerDeprecationWarning(Warning):
#     """Because standard deprecation warnings are ignored!"""
#     pass


import warnings
import astropy.units as u
import numpy as np
            import matplotlib.pyplot as plt
from astropy.table import Table
from astropy.time import Time
from astropy.utils.decorators import deprecated_renamed_argument
from .logging import logger
from .data_helpers import guess_time_format
from .exceptions import TheJokerDeprecationWarning
                from fuzzywuzzy import process
        from astropy.timeseries import TimeSeries
        from astropy.timeseries import TimeSeries
        """The times of each observation.

        Returns
        -------
        t : `~astropy.time.Time`
            An Astropy Time object for all times.
        """
        return Time(self._t_bmjd, scale='tcb', format='mjd')

    @property
    def cov(self):
        """Covariance matrix"""
        if self._has_cov:
            return self.rv_err
        else:
            return np.diag(self.rv_err.value**2) * self.rv_err.unit**2

    @property
    def ivar(self):
        """Inverse-variance."""
        if self._has_cov:
            return np.linalg.inv(self.rv_err.value) / self.rv_err.unit
        else:
            return 1 / self.rv_err ** 2

    # ------------------------------------------------------------------------
    # Other initialization methods:

    @classmethod
    @deprecated_renamed_argument('t0', 't_ref', since='v1.2',

# Path: thejoker/logging.py
# class JokerHandler(StreamHandler):
# class JokerLogger(logging.getLoggerClass()):
#     def emit(self, record):
#     def _set_defaults(self):
# 
# Path: thejoker/data_helpers.py
# def guess_time_format(time_val):
#     """Guess the `astropy.time.Time` format from the input value(s).
# 
#     Parameters
#     ----------
#     time_val : float, array_like
#         The value or values to guess the format from.
# 
#     Returns
#     -------
#     format : str
#         The `astropy.time.Time` format string, guessed from the value.
# 
#     """
#     arr = np.array(time_val)
# 
#     # Only support float or int times
#     if arr.dtype.char not in ['f', 'd', 'i', 'l']:
#         raise NotImplementedError("We can only try to guess "
#                                   "the time format with a numeric "
#                                   "time value. Sorry about that!")
# 
#     # HACK: magic number!
#     dt_thresh = 50*u.year
# 
#     jd_check = np.abs(arr - Time('2010-01-01').jd) * u.day < dt_thresh
#     jd_check = np.all(jd_check)
# 
#     mjd_check = np.abs(arr - Time('2010-01-01').mjd) * u.day < dt_thresh
#     mjd_check = np.all(mjd_check)
# 
#     err_msg = ("Unable to guess time format! Initialize with an "
#                "explicit astropy.time.Time() object instead.")
#     if jd_check and mjd_check:
#         raise ValueError(err_msg)
# 
#     elif jd_check:
#         return 'jd'
# 
#     elif mjd_check:
#         return 'mjd'
# 
#     else:
#         raise ValueError(err_msg)
# 
# Path: thejoker/exceptions.py
# class TheJokerDeprecationWarning(Warning):
#     """Because standard deprecation warnings are ignored!"""
#     pass


# Path: thejoker/data.py
import warnings
import astropy.units as u
import numpy as np
            import matplotlib.pyplot as plt
from astropy.table import Table
from astropy.time import Time
from astropy.utils.decorators import deprecated_renamed_argument
from .logging import logger
from .data_helpers import guess_time_format
from .exceptions import TheJokerDeprecationWarning
                from fuzzywuzzy import process
        from astropy.timeseries import TimeSeries
        from astropy.timeseries import TimeSeries

        """The times of each observation.

        Returns
        -------
        t : `~astropy.time.Time`
            An Astropy Time object for all times.
        """
        return Time(self._t_bmjd, scale='tcb', format='mjd')

    @property
    def cov(self):
        """Covariance matrix"""
        if self._has_cov:
            return self.rv_err
        else:
            return np.diag(self.rv_err.value**2) * self.rv_err.unit**2

    @property
    def ivar(self):
        """Inverse-variance."""
        if self._has_cov:
            return np.linalg.inv(self.rv_err.value) / self.rv_err.unit
        else:
            return 1 / self.rv_err ** 2

    # ------------------------------------------------------------------------
    # Other initialization methods:

    @classmethod
    @deprecated_renamed_argument('t0', 't_ref', since='v1.2',

                                 warning_type=TheJokerDeprecationWarning)