Luciano (lucianor@sinectis.com.ar) writes:
> I tried the following:
>
> IDL> Jul1=JulDay(3,31,1998,23)
> IDL> dummy=TIMEGEN(40,START=jul1,UNITS='Hours')
> IDL> caldat,dummy[39],month,day,year,hour
> IDL> print,year,month,day,hour
> 1998 4 1 14
>
> How adding 40 hours to 31/3,23h could end up in 1/4,14h??
> The problem seems to appear because TIMEGEN takes 30 as the first day, and not 31:
>
> IDL> caldat,dummy,month,day,year,hour
> IDL> print,day[0:4]
> 30 31 31 31 31
>
> Of course that if it starts at day 30/3 it will be correct to end at day 1/4
> But I'm telling it to start at day 31!!
>
> Any help??
>
> (I'm using IDL 5.4 on Windows XP)
I think it must be a problem with that version. I get this
with IDL 5.6 and Windows 2000:
IDL> Jul1=JulDay(3,31,1998,23)
% Compiled module: JULDAY.
IDL> dummy=TIMEGEN(40,START=jul1,UNITS='Hours')
% Compiled module: TIMEGEN.
% Compiled module: CALDAT.
IDL> caldat,dummy[39],month,day,year,hour
IDL> print,year,month,day,hour
1998 4 2 14
IDL> caldat,dummy,month,day,year,hour
IDL> print,day[0:4]
31 1 1 1 1
I get the same result you got in IDL 5.5.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|