# 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

        if d._has_cov:
            raise NotImplementedError("We currently don't support "
                                      "multi-survey data when a full "
                                      "covariance matrix is specified. "
                                      "Raise an issue in adrn/thejoker if "
                                      "you want this functionality.")

        if rv_unit is None:
            rv_unit = d.rv.unit

        t.append(d.t.tcb.mjd)
        rv.append(d.rv.to_value(rv_unit))
        err.append(d.rv_err.to_value(rv_unit))
        ids.append([k] * len(d))

    t = np.concatenate(t)
    rv = np.concatenate(rv) * rv_unit
    err = np.concatenate(err) * rv_unit
    ids = np.concatenate(ids)

    # validate number of unique ids vs. number of v0_offsets in prior
    if (len(np.unique(ids)) - 1) != n_offsets:
        raise ValueError("Number of data IDs + 1 must equal the number of "
                         "priors on constant offsets specified (i.e. "
                         "v0_offsets)")

    all_data = RVData(t=Time(t, format='mjd', scale='tcb'),
                      rv=rv, rv_err=err)


# 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


        if d._has_cov:
            raise NotImplementedError("We currently don't support "
                                      "multi-survey data when a full "
                                      "covariance matrix is specified. "
                                      "Raise an issue in adrn/thejoker if "
                                      "you want this functionality.")

        if rv_unit is None:
            rv_unit = d.rv.unit

        t.append(d.t.tcb.mjd)
        rv.append(d.rv.to_value(rv_unit))
        err.append(d.rv_err.to_value(rv_unit))
        ids.append([k] * len(d))

    t = np.concatenate(t)
    rv = np.concatenate(rv) * rv_unit
    err = np.concatenate(err) * rv_unit
    ids = np.concatenate(ids)

    # validate number of unique ids vs. number of v0_offsets in prior
    if (len(np.unique(ids)) - 1) != n_offsets:
        raise ValueError("Number of data IDs + 1 must equal the number of "
                         "priors on constant offsets specified (i.e. "
                         "v0_offsets)")

    all_data = RVData(t=Time(t, format='mjd', scale='tcb'),
                      rv=rv, rv_err=err)


    trend_M = get_trend_design_matrix(all_data, ids, poly_trend)