Last change
on this file since 205 was
205,
checked in by smasson, 17 years ago
|
improve the use of high frequency calendar
|
-
Property svn:keywords set to
Id
|
File size:
887 bytes
|
Line | |
---|
1 | ;------------------------------------------------------------ |
---|
2 | ;+ |
---|
3 | ; |
---|
4 | ; @file_comments |
---|
5 | ; gives yyyymmdd date equivalent of a Julian day |
---|
6 | ; |
---|
7 | ; @categories |
---|
8 | ; Calendar |
---|
9 | ; |
---|
10 | ; @param jday {in}{required} |
---|
11 | ; Julian day |
---|
12 | ; |
---|
13 | ; @returns |
---|
14 | ; date in yyyymmdd format |
---|
15 | ; |
---|
16 | ; @examples |
---|
17 | ; |
---|
18 | ; IDL> print, jul2date(julday(12,23,1999)) |
---|
19 | ; 19991223 |
---|
20 | ; |
---|
21 | ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
22 | ; June 2005 |
---|
23 | ; |
---|
24 | ; @version $Id$ |
---|
25 | ; |
---|
26 | ;- |
---|
27 | ;------------------------------------------------------------ |
---|
28 | function jul2date, jday |
---|
29 | ; |
---|
30 | compile_opt idl2, strictarrsubs |
---|
31 | ; |
---|
32 | caldat, jday, month, day, year, hour, min, sec |
---|
33 | ; |
---|
34 | res = (10000L*year + 100L*month + day)*(year GE 0) $ |
---|
35 | +( 10000L*year - 100L*month - day)*(year LT 0) |
---|
36 | ; |
---|
37 | IF total([hour NE 12, min NE 0, sec NE 0]) EQ 0 THEN return, long(res) $ |
---|
38 | ELSE return, double(res) + (hour / 24.0d0) + (min/1440.0d0) + (sec / 86400.0d0) |
---|
39 | |
---|
40 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.