Ticket #33167: patch-compat.py.diff

File patch-compat.py.diff, 1.2 KB (added by lsinger@…, 12 years ago)
  • compat/compat.py

    diff -ur NOVAS_Py-3.1.orig/compat/compat.py NOVAS_Py-3.1/compat/compat.py
    old new  
    30573057    limb_ang = c_double()
    30583058    nadir_ang = c_double()
    30593059
    3060     _limb_angle = ((c_double*3)(*pos_obj), (c_double*3)(*pos_obs),
     3060    _limb_angle ((c_double*3)(*pos_obj), (c_double*3)(*pos_obs),
    30613061                   byref(limb_ang), byref(nadir_ang))
    30623062
    30633063    return limb_ang.value, nadir_ang.value
     
    31603160
    31613161    return jd
    31623162
    3163 def cal_date(day):
     3163def cal_date(jd):
    31643164    """
    31653165    Return the Gregorian date for a given Julian day.
    31663166   
     
    31843184   
    31853185    """
    31863186
    3187     if day < 0.0: raise ValueError(_neg_err % {'name': 'day'})
     3187    if jd < 0.0: raise ValueError(_neg_err % {'name': 'jd'})
    31883188
    31893189    _cal_date = novaslib.cal_date
    31903190    _cal_date.argtypes = (c_double, POINTER(c_short), POINTER(c_short),
     
    31963196    day = c_short()
    31973197    hour = c_double()
    31983198
    3199     _cal_date(day, byref(year), byref(month), byref(day), byref(hour))
     3199    _cal_date(jd, byref(year), byref(month), byref(day), byref(hour))
    32003200
    32013201    return year.value, month.value, day.value, hour.value
    32023202