[2] | 1 | ;+ |
---|
[232] | 2 | ; |
---|
[127] | 3 | ; @file_comments |
---|
| 4 | ; sets s_fichier to name of the vairmer file associated |
---|
| 5 | ; to the given date in vairmer format ( yymmdd ) |
---|
[2] | 6 | ; |
---|
[97] | 7 | ; @obsolete |
---|
[2] | 8 | ; |
---|
[231] | 9 | ; @param vdate {in} |
---|
| 10 | ; date vairmer ex:930124 |
---|
[127] | 11 | ; |
---|
[231] | 12 | ; @param dim {in} |
---|
| 13 | ; 'so' ou 'vo' par defaut so est choisi |
---|
[127] | 14 | ; |
---|
[231] | 15 | ; @param nomexp {in} |
---|
| 16 | ; nom de l'experience en trois lettres par defaut prefix |
---|
[2] | 17 | ; |
---|
[231] | 18 | ; @returns |
---|
| 19 | ; le nom du fichier vairmer (depuis iodir) |
---|
[2] | 20 | ; |
---|
[231] | 21 | ; @uses |
---|
| 22 | ; common.pro |
---|
[2] | 23 | ; |
---|
[103] | 24 | ; @examples |
---|
[97] | 25 | ; IDL> fic = ficdate(930124) |
---|
[2] | 26 | ; |
---|
[231] | 27 | ; @history |
---|
| 28 | ; Jerome Vialard (jv\@lodyc.jussieu.fr) |
---|
| 29 | ; 1/7/98 |
---|
[118] | 30 | ; |
---|
[231] | 31 | ; @version |
---|
| 32 | ; $Id$ |
---|
[118] | 33 | ; |
---|
[2] | 34 | ;- |
---|
[231] | 35 | ; |
---|
[2] | 36 | function ficdate, vdate, dim, nomexp |
---|
[114] | 37 | ; |
---|
| 38 | compile_opt idl2, strictarrsubs, obsolete |
---|
| 39 | ; |
---|
[2] | 40 | @common |
---|
| 41 | ;------------------------------------------------------------ |
---|
| 42 | case n_params() of |
---|
| 43 | 1: dim = 'SO' |
---|
| 44 | 2: dim=strupcase(dim) |
---|
| 45 | 3: begin |
---|
| 46 | prefix=nomexp |
---|
| 47 | dim=strupcase(dim) |
---|
| 48 | end |
---|
| 49 | endcase |
---|
| 50 | ;------------------------------------------------------------ |
---|
| 51 | ; constitution de l'adresse ou aller chercher le fichier |
---|
| 52 | ;-------------------------------------------------------------- |
---|
| 53 | ; date yymmdd = vdate |
---|
| 54 | ; sets month, year and day to the good value : |
---|
| 55 | rien = juldate(vdate) |
---|
| 56 | ; constitution de la date yymmdd |
---|
[118] | 57 | case 1 of |
---|
[2] | 58 | year lt 10: s_year ='0'+string(format='(i1)',year) |
---|
| 59 | year ge 10 and year lt 100:s_year= string(format='(i2)',year) |
---|
[118] | 60 | year ge 100:BEGIN |
---|
[2] | 61 | year = year-1900 |
---|
| 62 | if year LT 10 then s_year ='0'+string(format='(i1)',year) $ |
---|
| 63 | ELSE s_year =string(format='(i2)',year) |
---|
| 64 | end |
---|
| 65 | endcase |
---|
| 66 | if month lt 10 then s_month='0'+string(format='(i1)',month) $ |
---|
| 67 | else s_month= string(format='(i2)',month) |
---|
| 68 | if day lt 10 then s_day='0'+string(format='(i1)',day) $ |
---|
| 69 | else s_day= string(format='(i2)',day) |
---|
| 70 | ; |
---|
| 71 | case dim of |
---|
| 72 | 'SO': begin |
---|
| 73 | case 1 of |
---|
| 74 | (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.SO' |
---|
| 75 | (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.SO'+s_month |
---|
| 76 | (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.SO'+s_year |
---|
| 77 | (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.SO'+s_year+s_month |
---|
| 78 | else: s_fichier=iodir+prefix+'O..SO'+s_year+s_month+s_day |
---|
| 79 | endcase |
---|
| 80 | end |
---|
| 81 | 'VO': begin |
---|
| 82 | case 1 of |
---|
| 83 | (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.VO' |
---|
| 84 | (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.VO'+s_month |
---|
| 85 | (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.VO'+s_year |
---|
| 86 | (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.VO'+s_year+s_month |
---|
| 87 | else: s_fichier=iodir+prefix+'O..VO'+s_year+s_month+s_day |
---|
| 88 | endcase |
---|
| 89 | end |
---|
| 90 | else: return, report('le fichier doit etre VO ou SO') |
---|
| 91 | endcase |
---|
| 92 | ; |
---|
| 93 | ; print,' ' |
---|
| 94 | ; print,' adresse du fichier: ',fichier |
---|
| 95 | ;------------------------------------------------------------ |
---|
| 96 | return, s_fichier |
---|
| 97 | ;------------------------------------------------------------ |
---|
| 98 | end |
---|
| 99 | ;------------------------------------------------------------ |
---|