def to_pyrocko_trace(trace):
    """
    Convert ObsPy trace object to Pyrocko trace object.

    :param trace:
        :py:class:`obspy.Trace <obspy.core.trace.Trace>` object
    :returns:
        :py:class:`pyrocko.trace.Trace` object
    """
    obspy_trace = trace
    from pyrocko import trace
    return trace.Trace(str(obspy_trace.stats.network), str(obspy_trace.
        stats.station), str(obspy_trace.stats.location), str(obspy_trace.
        stats.channel), tmin=obspy_trace.stats.starttime.timestamp, tmax=
        obspy_trace.stats.endtime.timestamp, ydata=obspy_trace.data, deltat
        =obspy_trace.stats.delta)
