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