1 | ;+ |
---|
2 | ; |
---|
3 | ; @file_comments |
---|
4 | ; gives julian date equivalent of a date in vairmer |
---|
5 | ; ( yymmdd or yyyymmdd ) format |
---|
6 | ; sets month, day and year to the corresp values |
---|
7 | ; |
---|
8 | ; you better use date2jul |
---|
9 | ; |
---|
10 | ; @obsolete |
---|
11 | ; |
---|
12 | ; @categories |
---|
13 | ; Calendar |
---|
14 | ; |
---|
15 | ; @param vvdate {in} |
---|
16 | ; date de la forme yymmdd ou yyyymmdd |
---|
17 | ; |
---|
18 | ; @keyword _EXTRA |
---|
19 | ; Used to pass keywords |
---|
20 | ; |
---|
21 | ; @uses |
---|
22 | ; common.pro |
---|
23 | ; vraidate |
---|
24 | ; |
---|
25 | ; @returns |
---|
26 | ; date en jour julien |
---|
27 | ; l'annee 0 n'existant pas, qd year est nulle on calcule le |
---|
28 | ; jour julien de l'annee -1. |
---|
29 | ; COMPATIBLE AVEC L'AN 2000 !!!: une date de la forme yymmdd est |
---|
30 | ; convertit sous la forme yyyymmdd a l''aide de vraidate. |
---|
31 | ; Attention, les variables globales year, month day sont attribuees |
---|
32 | ; |
---|
33 | ; @examples |
---|
34 | ; IDL> date = juldate(930124) |
---|
35 | ; |
---|
36 | ; @history |
---|
37 | ; Jerome Vialard (jv\@lodyc.jussieu.fr) |
---|
38 | ; 2/7/98 |
---|
39 | ; |
---|
40 | ; @version |
---|
41 | ; $Id$ |
---|
42 | ; |
---|
43 | ;- |
---|
44 | function juldate, vvdate, _EXTRA=ex |
---|
45 | ; |
---|
46 | compile_opt idl2, strictarrsubs, obsolete |
---|
47 | ; |
---|
48 | vdate = vvdate |
---|
49 | vdate = vraidate(vdate, _EXTRA = ex) |
---|
50 | @common |
---|
51 | ;------------------------------------------------------------ |
---|
52 | year=vdate/10000 |
---|
53 | month=vdate/100 - year*100 |
---|
54 | day=abs(vdate - year*10000 - month*100) |
---|
55 | month = abs(month) |
---|
56 | ; |
---|
57 | mm = month & dd = day & yy = year |
---|
58 | ;------------------------------------------------------------ |
---|
59 | ndate = n_elements(vdate) |
---|
60 | if total(mm EQ 0) EQ ndate then mm[*] = 6 |
---|
61 | if total(dd EQ 0) EQ ndate then dd[*] = 15 |
---|
62 | if total(yy EQ 0) EQ ndate THEN yy[*] = -1 |
---|
63 | ;------------------------------------------------------------ |
---|
64 | return, julday(mm,dd,yy, _EXTRA = ex) |
---|
65 | ;------------------------------------------------------------ |
---|
66 | return, -1 |
---|
67 | end |
---|
68 | ;------------------------------------------------------------ |
---|