[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JULDAY 5.4 not same as 5.3?




Hi Don,

The problem is with using an unsigned long integer. Inside JULDAY.PRO,
it subtracts 12 off of the hours before dividing by 24. This will cause
wrap-around for unsigned longs and unsigned long64s.

So you should be able to fix (no pun!) your problem by:

   in_jday = julday( umm, udd, uyear, FIX(uhr), umin, usec )

This bug has been logged with RSI, and will be fixed in the next IDL
version.

Cheers,
Chris Torrence
Research Systems, Inc.


Don Woodraska wrote:
> 
> Has anyone else noticed a bug in JULDAY that appeared in 5.4?
> 
> I tried this in IDL 5.3:
> 
> IDL> help,umm,udd,uyear,uhr,umin,usec
> UMM             LONG      =            2
> UDD             LONG      =           16
> UYEAR           LONG      =         2001
> UHR             ULONG     =            0
> UMIN            ULONG     =            0
> USEC            ULONG     =            0
> IDL> in_jday = julday( umm, udd, uyear, uhr, umin, usec )
> IDL> gps0_jday = julday(1,6,1980,0,0,0)
> 
...
> IDL> in_jday = julday( umm, udd, uyear, uhr, umin, usec )
> IDL> gps0_jday = julday(1,6,1980,0,0,0)
> IDL> help,in_jday,gps0_jday
> IN_JDAY         DOUBLE    =    1.8140893e+08
> GPS0_JDAY       DOUBLE    =        2444244.5
>