CalDat [message #25034] |
Tue, 15 May 2001 12:07  |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
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
|
|
|
Re: CalDat [message #25120 is a reply to message #25034] |
Wed, 16 May 2001 09:59  |
R.G.S.
Messages: 46 Registered: September 2000
|
Member |
|
|
Ben Tupper <pemaquidriver@tidewater.net> wrote in message
news:3B017E66.BD5C9F6D@tidewater.net...
> Hello,
>
>
> 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)
I don't think it is a bug. Single precision numbers only give you
0.25 in terms of julian days
Check out the following code
print,'Singl prec #:'
print,float(2529161.36d),format='(f50.25)'
CALDAT,2529161.36d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Doubl: ',Month, Day, Year, Hour, Minute, Second
CALDAT, 2529161.36, Month, Day, Year, Hour, Minute,Second
PRINT, 'Float: ',Month, Day, Year, Hour, Minute, Second
CALDAT, 2529161.25d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Round Doub:',Month, Day, Year, Hour, Minute, Second
print,'Next Singl prec #:'
print,float(2529161.45d),format='(f50.25)'
CALDAT,2529161.45d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Doubl: ',Month, Day, Year, Hour, Minute, Second
CALDAT, 2529161.45, Month, Day, Year, Hour, Minute,Second
PRINT, 'Float: ',Month, Day, Year, Hour, Minute, Second
CALDAT, 2529161.5d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Round Doub:',Month, Day, Year, Hour, Minute, Second
;****************** Results Below *****************************************
Singl prec #:
2529161.2500000000000000000000000
Doubl: 7 4 2212 20
38 23.999989
Float: 7 4 2212 18
0 0.00000000
Round Doub: 7 4 2212 18 0
0.00000000
Next Singl prec #:
2529161.5000000000000000000000000
Doubl: 7 4 2212 22
48 1.6093257e-005
Float: 7 5 2212 0
0 0.00000000
Round Doub: 7 5 2212 0 0
0.00000000
Cheers,
bob stockwell
|
|
|