import time


def sisock_to_unix_time(t):
    """Convert a sisock timestamp to a UNIX timestamp.

    Parameters
    ----------
    t : float
        A sisock timestamp.

    Returns
    -------
    unix_time : float
        If `t` is positive, return `t`. If `t` is zero or negative, return
        :math:`time.time() - t`.
    """
    if t > 0:
        return t
    else:
        return time.time() + t