def seconds(ts, epoch_offset_sec=631152000) -> float:
    """
    Converts LCLS2 timestamp to unix epoch time.
    The epoch used is 1-Jan-1990 rather than 1970. -Matt

    Receives  ts = orun.timestamp  # 4193682596073796843 relative to 1990-01-01
    Returns unix epoch time in sec # 1607569818.532117 sec

    import datetime
    epoch_offset_sec=(datetime.datetime(1990, 1, 1)-datetime.datetime(1970, 1, 1)) / datetime.timedelta(seconds=1)
    """
    return float(ts>>32) + float(ts&0xffffffff)*1.e-9 + epoch_offset_sec