| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi IDL Wizards, 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? --Edward H. |
|
#2
| |||
| |||
| 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.") |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.