def gpsWeekCheck(t):
    """Makes sure the time is in the interval [-302400 302400] seconds, which
    corresponds to number of seconds in the GPS week"""
    if t > 302400.:
        t = t - 604800.
    elif t < -302400.:
        t = t + 604800.
    return t