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