source: trunk/SRC/Obsolete/juldate.pro @ 261

Last change on this file since 261 was 232, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:keywords set to Id
File size: 1.6 KB
RevLine 
[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]45function juldate, vvdate, _EXTRA = ex
[114]46;
47  compile_opt idl2, strictarrsubs, obsolete
48;
[2]49vdate = vvdate
50vdate = 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
68end
69;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.