# Path: thejoker/likelihood_helpers.py
# def get_trend_design_matrix(data, ids, poly_trend):
#     """
#     Construct the full design matrix for linear parameters, without the K column
#     """
#     # Combine design matrix for constant term, which may contain columns for
#     # sampling over v0 offsets, with the rest of the long-term trend columns
#     const_M = get_constant_term_design_matrix(data, ids)
#     dt = data._t_bmjd - data._t_ref_bmjd
#     trend_M = np.vander(dt, N=poly_trend, increasing=True)[:, 1:]
#     return np.hstack((const_M, trend_M))


from astropy.time import Time
from .likelihood_helpers import get_trend_design_matrix
    from .data import RVData
import astropy.units as u
import numpy as np
    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)


def validate_prepare_data(data, poly_trend, n_offsets):
    """Internal function.

    Used to take an input ``RVData`` instance, or a list/dict of ``RVData``
    instances, and produce concatenated time, RV, and error arrays, along
    with a consistent t0.
    """
    if isinstance(data, RVData):  # single instance
        if n_offsets != 0:
            raise ValueError("If sampling over velocity offsets between data "
                             "sources, you must pass in multiple data sources."
                             " To do this, pass in a list of RVData instances "
                             "or a dictionary with RVData instances as values."
                             )


# Path: thejoker/likelihood_helpers.py
# def get_trend_design_matrix(data, ids, poly_trend):
#     """
#     Construct the full design matrix for linear parameters, without the K column
#     """
#     # Combine design matrix for constant term, which may contain columns for
#     # sampling over v0 offsets, with the rest of the long-term trend columns
#     const_M = get_constant_term_design_matrix(data, ids)
#     dt = data._t_bmjd - data._t_ref_bmjd
#     trend_M = np.vander(dt, N=poly_trend, increasing=True)[:, 1:]
#     return np.hstack((const_M, trend_M))


# Path: thejoker/data_helpers.py
from astropy.time import Time
from .likelihood_helpers import get_trend_design_matrix
    from .data import RVData
import astropy.units as u
import numpy as np

    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)


def validate_prepare_data(data, poly_trend, n_offsets):
    """Internal function.

    Used to take an input ``RVData`` instance, or a list/dict of ``RVData``
    instances, and produce concatenated time, RV, and error arrays, along
    with a consistent t0.
    """
    if isinstance(data, RVData):  # single instance
        if n_offsets != 0:
            raise ValueError("If sampling over velocity offsets between data "
                             "sources, you must pass in multiple data sources."
                             " To do this, pass in a list of RVData instances "
                             "or a dictionary with RVData instances as values."
                             )


        trend_M = get_trend_design_matrix(data, None, poly_trend)