[2] | 1 | ;+ |
---|
[232] | 2 | ; |
---|
[231] | 3 | ; @file_comments |
---|
[127] | 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 | ; |
---|
[97] | 10 | ; @obsolete |
---|
[2] | 11 | ; |
---|
[231] | 12 | ; @categories |
---|
[157] | 13 | ; Calendar |
---|
[2] | 14 | ; |
---|
[231] | 15 | ; @param vvdate {in} |
---|
| 16 | ; date de la forme yymmdd ou yyyymmdd |
---|
[2] | 17 | ; |
---|
[231] | 18 | ; @keyword _EXTRA |
---|
| 19 | ; Used to pass keywords |
---|
[118] | 20 | ; |
---|
[231] | 21 | ; @uses |
---|
| 22 | ; common.pro |
---|
| 23 | ; vraidate |
---|
[2] | 24 | ; |
---|
[231] | 25 | ; @returns |
---|
| 26 | ; date en jour julien |
---|
[2] | 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 |
---|
[118] | 30 | ; convertit sous la forme yyyymmdd a l''aide de vraidate. |
---|
[2] | 31 | ; Attention, les variables globales year, month day sont attribuees |
---|
| 32 | ; |
---|
[118] | 33 | ; @examples |
---|
[97] | 34 | ; IDL> date = juldate(930124) |
---|
| 35 | ; |
---|
[231] | 36 | ; @history |
---|
| 37 | ; Jerome Vialard (jv\@lodyc.jussieu.fr) |
---|
[97] | 38 | ; 2/7/98 |
---|
[118] | 39 | ; |
---|
[231] | 40 | ; @version |
---|
| 41 | ; $Id$ |
---|
[118] | 42 | ; |
---|
[2] | 43 | ;- |
---|
[231] | 44 | ; |
---|
[2] | 45 | function juldate, vvdate, _EXTRA = ex |
---|
[114] | 46 | ; |
---|
| 47 | compile_opt idl2, strictarrsubs, obsolete |
---|
| 48 | ; |
---|
[2] | 49 | vdate = vvdate |
---|
| 50 | vdate = vraidate(vdate, _EXTRA = ex) |
---|
| 51 | @common |
---|
| 52 | ;------------------------------------------------------------ |
---|
| 53 | year=vdate/10000 |
---|
| 54 | month=vdate/100 - year*100 |
---|
| 55 | day=abs(vdate - year*10000 - month*100) |
---|
| 56 | month = abs(month) |
---|
| 57 | ; |
---|
| 58 | mm = month & dd = day & yy = year |
---|
| 59 | ;------------------------------------------------------------ |
---|
[118] | 60 | ndate = n_elements(vdate) |
---|
[2] | 61 | if total(mm EQ 0) EQ ndate then mm[*] = 6 |
---|
| 62 | if total(dd EQ 0) EQ ndate then dd[*] = 15 |
---|
| 63 | if total(yy EQ 0) EQ ndate THEN yy[*] = -1 |
---|
| 64 | ;------------------------------------------------------------ |
---|
| 65 | return, julday(mm,dd,yy, _EXTRA = ex) |
---|
| 66 | ;------------------------------------------------------------ |
---|
| 67 | return, -1 |
---|
| 68 | end |
---|
| 69 | ;------------------------------------------------------------ |
---|