Re: Day of Year... Too lazy for a two-line solution... [message #62104] |
Fri, 22 August 2008 12:43 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ed Hyer writes:
> I handle all date manipulation in my routines using JULDAY(), CALDAT,
> and the C() format code. Going from Day-of-Year to Julian Date is
> easy:
>
> Julian_Date = JULDAY(1,Day_Of_Year,Year,0,0,0)
>
> Getting Day-of-Year back out requires this, *unless you can do
> better*:
>
> CALDAT,Julian_Date,Null,Null,Year
> Day_Of_Year = Julian_Date - JULDAY(12,31,Year-1,0,0,0)
>
> I would really like a one-line solution with no stray variables.
> Anyone have one?
Would a call to a three-line function qualify as an answer?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|