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

CalDat



Hello,

I think I have found bugs in the  the CalDat procedure.  I
thought it best to run it by here before contacting RSI.

This is from the online help:


> ... use something like:
> CALDAT, 2529161.36, Month, Day, Year, Hour, Minute, Second
> PRINT, Month, Day, Year, Hour, Minute, Second
>

Here are my observations:

1)   Unless the Julian Day Number is double precision, the
minute and hour are always zero.
2)   I don't believe the hour is correctly determing when
the Julian Day number is provided as single precision.
If the Julian Day begins at 1200 on a given day, then 0.36 *
24 + 12 = 20.6  (fraction of day * hours per day + offset =
hour number of day)

As single precision:

IDL> CALDAT, 2529161.36, Month, Day, Year, Hour, Minute,
Second
IDL> PRINT, Month, Day, Year, Hour, Minute, Second
           7           4        2212          18
0      0.00000000

As double precision:

IDL> CALDAT, 2529161.36d, Month, Day, Year, Hour, Minute,
Second
IDL> PRINT, Month, Day, Year, Hour, Minute, Second
           7           4        2212          20
38       23.999989

As long integer:

IDL> CALDAT, 2529161L, Month, Day, Year, Hour, Minute,
Second
IDL> PRINT, Month, Day, Year, Hour, Minute, Second
           7           4        2212          12
0      0.00000000


I hope some folks will confirm this result on other machines
before I send along a bug report to RSI; perhaps this has
been noted before.

IDL> print, !version
{ x86 Win32 Windows 5.4 Sep 25 2000      32      64}


Thanks,

Ben
--
Ben Tupper
248 Lower Round Pond Road
POB 106
Bristol, ME 04539

Tel: (207) 563-1048
Email: PemaquidRiver@tidewater.net