def gpst2jd(gps_week, gps_dow=None, gps_sow=None):
    """
    GPS time to jd
    """
    if gps_sow is None:
        if gps_dow is None:
            raise ValueError("Lack of parameters!")
        else:
            gps_sow = gps_dow * 86400
    gps_start_mjd = 44243
    fraction  = (gps_sow % 86400) / 86400
    mjd = gps_start_mjd + gps_sow // 86400 + gps_week * 7 + 1
    jd = mjd + 2400000.5 + fraction
    return jd