Changeset 42 for trunk/ToBeReviewed


Ignore:
Timestamp:
05/02/06 17:24:47 (18 years ago)
Author:
pinsard
Message:

upgrade of PLOTS according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/

Location:
trunk/ToBeReviewed/PLOTS
Files:
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/ToBeReviewed/PLOTS/axe.pro

    r41 r42  
    2525;        date. Par defaut c''est un retour a la ligne qd on fait un 
    2626;        'yt', 'zt' ou 't' dans les autres cas c''est un blanc.  
     27; 
     28;        DIGITSYEAR=2 to use %Z format (2 digits) to code years 
     29;        instead of %Y format. See help of label_date for more 
     30;        informations on %Z and %Y. 
    2731; 
    2832; OUTPUTS:les variables globales d''environnement graphique: !x. et !y. 
     
    4549;------------------------------------------------------------ 
    4650;------------------------------------------------------------ 
    47 PRO axe, coupe,tempsmin,tempsmax, REVERSE_X = reverse_x, REVERSE_Y = reverse_y, SIN = sin, SEPDATE = sepdate, _EXTRA = ex 
     51PRO axe, coupe,tempsmin,tempsmax, REVERSE_X = reverse_x, REVERSE_Y = reverse_y, SIN = sin, SEPDATE = sepdate, DIGITSYEAR = digitsyear, _EXTRA = ex 
    4852@common 
    4953   tempsun = systime(1)         ; pour key_performance 
     
    6064      caldat,tempsmin, mmin, dmin, ymin, hmin, mnmin, smin, _EXTRA = ex 
    6165      caldat,tempsmax, mmax, dmax, ymax, hmax, mnmax, smax, _EXTRA = ex 
    62  
    63  
     66; format used for the year (2 or 4/5 digits). 
     67      IF NOT keyword_set(digitsyear) THEN digitsyear = 4 
     68      IF digitsyear EQ 2 THEN fmtyr = '%Z' ELSE fmtyr = '%Y' 
     69; 
    6470      if ymax EQ ymin then BEGIN 
    6571         if mmin ne mmax then BEGIN 
     
    6975            for m = 0,nticks-1 do ticknom[m] = julday(m+mmin, 1, ymin, _EXTRA = ex) 
    7076            tminor = 6 
    71             datfmt = '%M'+sep+'%Z' 
     77            datfmt = '%M'+sep+fmtyr 
    7278; on verifie que les labels rentrent bien entre tempsmin et tempsmax... 
    7379            ticknom = ticknom[where(ticknom GE tempsmin AND ticknom LE tempsmax AND ticknom NE -1)] 
     
    7581; cas particulier ou l''on est a cheval sur 2 mois 
    7682            if nticks LE 1 then begin 
    77                nticks = (dmax+jourdsmois(mmin, ymin)-dmin+1)/2 
     83               nticks = (dmax+(jourdsmois(mmin, ymin))[0]-dmin+1)/2 
    7884               ticknom = lonarr(nticks) 
    7985               for d = 0,nticks-1 do ticknom[d] = julday(mmin, d*2+dmin, ymin, _EXTRA = ex) 
     
    109115; plusieurs annees 
    110116         CASE 1 OF 
    111          ymax-ymin+1 LE 10: BEGIN & freq = 1. & tminor = 12 & datfmt = '%M'+sep+'%Z' & end 
    112          ymax-ymin+1 LE 20: BEGIN & freq = 2. & tminor = 6 & datfmt = '%M'+sep+'%Z' & end 
    113          ymax-ymin+1 LE 50: BEGIN & freq = 5. & tminor = 5 & datfmt = '%M'+sep+'%Z' & end 
    114          ymax-ymin+1 LE 100: BEGIN & freq = 10. & tminor = 10 & datfmt = '%Z' & end 
    115          ELSE : BEGIN & freq = 20 & tminor = 20 & datfmt = '%Y' & end 
     117         ymax-ymin+1 LE 10: BEGIN & freq = 1. & tminor = 12 & datfmt = '%M'+sep+fmtyr & end 
     118         ymax-ymin+1 LE 20: BEGIN & freq = 2. & tminor = 6 & datfmt = '%M'+sep+fmtyr & end 
     119         ymax-ymin+1 LE 50: BEGIN & freq = 5. & tminor = 5 & datfmt = '%M'+sep+fmtyr & end 
     120         ymax-ymin+1 LE 100: BEGIN & freq = 10. & tminor = 10 & datfmt = fmtyr & end 
     121         ymax-ymin+1 LE 1000: BEGIN & freq = 50. & tminor = 5 & datfmt = fmtyr & end 
     122         ELSE : BEGIN & freq = 100. & tminor = 50 & datfmt = '%Y' & end 
    116123         ENDCASE  
    117124         nticks = floor((ymax-ymin)/freq)+1 
     
    132139            nticks = n_elements(ticknom) 
    133140            tminor = 6 
    134             datfmt = '%M'+sep+'%Z' 
     141            datfmt = '%M'+sep+fmtyr 
    135142; cas particulier ou l''on est a cheval sur 2 mois 
    136143            if nticks LE 1 then begin 
    137                nticks = (dmax+jourdsmois(mmin, ymin)-dmin+1)/2 
     144               nticks = (dmax+(jourdsmois(mmin, ymin))[0]-dmin+1)/2 
    138145               ticknom = lonarr(nticks) 
    139146               for d = 0,nticks-1 do ticknom[d] = julday(mmin, d*2+dmin, ymin, _EXTRA = ex) 
     
    156163         if keyword_set(reverse_x) then !x.range=[lon2,lon1] ELSE !x.range=[lon1,lon2] 
    157164         if keyword_set(reverse_y) then !y.range=[lat2,lat1] ELSE !y.range=[lat1,lat2] 
    158          !x.tickformat='lonaxe' 
    159          !y.tickformat='lataxe' 
     165         IF key_onearth THEN !x.tickformat='lonaxe' 
     166         IF key_onearth THEN !y.tickformat='lataxe' 
    160167      END 
    161168      'yz':BEGIN  
     
    187194         if keyword_set(reverse_y) then !y.range=[tempsmax, tempsmin]-tempsmin $ 
    188195         ELSE !y.range=[tempsmin,tempsmax]-tempsmin 
    189          !x.tickformat='lonaxe' 
    190 ;          result = LABEL_DATE(DATE_FORMAT = '%M'+sep+'%Z') 
     196         IF key_onearth THEN !x.tickformat='lonaxe' 
     197;          result = LABEL_DATE(DATE_FORMAT = '%M'+sep+fmtyr) 
    191198;          !y.tickformat='LABEL_DATE' 
    192199         !y.tickname = LABEL_DATE(1, 0,ticknom,_EXTRA = ex)  
     
    203210         ELSE !x.range=[tempsmin,tempsmax]-tempsmin 
    204211         if keyword_set(reverse_y) then !y.range=[lat2, lat1] ELSE !y.range=[lat1,lat2] 
    205          !y.tickformat='lataxe' 
     212         IF key_onearth THEN !y.tickformat='lataxe' 
    206213         !x.tickname = LABEL_DATE(0, 0,ticknom,_EXTRA = ex)  
    207214         !x.ticklen=1. 
     
    240247      'x' : begin 
    241248         !x.range=[lon1,lon2] 
    242          !x.tickformat='lonaxe' 
     249         IF key_onearth THEN !x.tickformat='lonaxe' 
    243250      END 
    244251      'y' : begin 
     
    259266            !x.range = sin(!pi/180.*!x.range) 
    260267         ENDIF ELSE !x.range=[lat1,lat2] 
    261          !x.tickformat='lataxe' 
     268         IF key_onearth THEN !x.tickformat='lataxe' 
    262269      END 
    263270      'z' : begin 
  • trunk/ToBeReviewed/PLOTS/legende.pro

    r41 r42  
    4545pro legende,mi,ma,coupe,CONTOUR = contour,ENDPOINTS = endpoints, DIREC = direc $ 
    4646            , VECTLEGENDE = vectlegende $ 
    47             , INTERVALLE = intervalle, YZ_TYPE = yz_type, VARNAME2 = varname2 $ 
     47            , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $ 
    4848            , NPTS = npts, _EXTRA = ex 
    4949@common 
    5050   tempsun = systime(1)         ; pour key_performance 
    5151;------------------------------------------------------------ 
    52    grille, mask, glam, gphi, gdep, nx, ny, nz & mask = 1 
    53 ; 
    54 ; choose langage 
    55 ; 
    56    if n_elements(langage) EQ 0 then langage = 'non definit' 
    57    CASE langage OF 
    58       'gb': BEGIN 
     52   grille, -1, -1, -1, gdep, nx, ny, nz 
    5953; 
    6054; English legends 
    6155; 
    62          fmt_mm = '(f12.2)' 
    63          fmt_bt = '(f7.1)' 
    64          colorf = '' 
    65          contourf = 'Contour plot,' 
    66          vecteurf = 'Vector norm  ' 
    67          expf = '' 
    68          datef = '   ' 
    69          fieldf = '   ' 
    70          depthf = '   ' 
    71          endpointsf = 'Diag. Section' 
    72          zonalf = '' 
    73          latintf = 'latitudes in ' 
    74          timintf = 'time in ' 
    75          onf = ' - ' 
    76          depthf2 = 'Depth (m)' 
    77          Meridf = 'Zonal Mean  ' 
    78          lonintf = 'longitudes in ' 
    79          hovxt = 'XT-plot   ' 
    80          diaghovxt = 'Diag. XT-plot   ' 
    81          depintf = 'depths in ' 
    82          timef = 'Time' 
    83          hovyt = 'YT-plot   ' 
    84          diaghovyt = 'Diag. YT-plot   ' 
    85          hovzt = 'ZT-plot   ' 
    86          hovt = '' 
    87       END  
    88 ; 
    89 ; Legendes en francais 
    90 ; 
    91       ELSE: BEGIN  
    92          fmt_mm = '(f12.2)' 
    93          fmt_bt = '(f7.1)' 
    94          colorf = 'Champ en couleur ' 
    95          contourf = 'Champ en trace noir ' 
    96          vecteurf = 'Norme vecteur ' 
    97          expf = 'exp: ' 
    98          datef = ', date: ' 
    99          fieldf = ', champ: ' 
    100          depthf = ', profondeur: ' 
    101          endpointsf = 'Diag. Section, exp: ' 
    102          zonalf = 'Coupe Zonale, exp: ' 
    103          latintf = 'latitude in ' 
    104          timintf = 'time in ' 
    105          onf = ' - ' 
    106          depthf2 = 'Profondeur (m)' 
    107          meridf = 'Coupe Meridienne, exp: ' 
    108          lonintf = 'longitude in ' 
    109          hovxt = 'Trace Longitude-Temps, exp: ' 
    110          diaghovxt = 'Trace Diag. Longitude-Temps, exp: ' 
    111          depintf = 'profondeur in ' 
    112          timef = 'Temps' 
    113          hovyt = 'Trace Latitude-Temps, exp: ' 
    114          diaghovyt = 'Trace Diag. Latitude-Temps, exp: ' 
    115          hovzt = 'Trace Profondeur-Temps, exp: ' 
    116          hovt = 'Evolution Temporelle, exp: ' 
    117       END 
    118  
    119    ENDCASE  
     56   fmt_mm = '(f12.2)' 
     57   fmt_bt = '(f7.1)' 
     58   colorf = '' 
     59   contourf = 'Contour plot,' 
     60   vecteurf = 'Vector norm  ' 
     61   expf = '' 
     62   datef = '   ' 
     63   fieldf = '   ' 
     64   depthf = '   ' 
     65   endpointsf = 'Diag. Section' 
     66   zonalf = '' 
     67   IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in ' 
     68   timintf = 'time in ' 
     69   onf = ' - ' 
     70   depthf2 = 'Depth (m)' 
     71   Meridf = 'Zonal Mean  ' 
     72   IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in ' 
     73   hovxt = 'XT-plot   ' 
     74   diaghovxt = 'Diag. XT-plot   ' 
     75   depintf = 'depths in ' 
     76   timef = 'Time' 
     77   hovyt = 'YT-plot   ' 
     78   diaghovyt = 'Diag. YT-plot   ' 
     79   hovzt = 'ZT-plot   ' 
     80   hovt = '' 
     81   IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index' 
     82   IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index' 
     83    
    12084   vertz = depthf2 
    12185   legniv = ' m' 
    122    IF keyword_set(YZ_TYPE) THEN BEGIN 
    123       IF yz_type EQ 'hPa' THEN vertz = 'hPa'  
    124       IF yz_type EQ 'hPa' THEN legniv = ' hPa'  
     86   IF keyword_set(TYPE_YZ) THEN BEGIN 
     87     IF type_yz EQ 'hPa' THEN vertz = 'hPa'  
     88     IF type_yz EQ 'hPa' THEN legniv = ' hPa'  
    12589   ENDIF  
    12690; 
     
    158122   lo1=strtrim(string(format=fmt_bt, lon1), 2) 
    159123   lo2=strtrim(string(format=fmt_bt, lon2), 2) 
    160    pr1=strtrim(string(format=fmt_bt, prof1), 2) 
    161    pr2=strtrim(string(format=fmt_bt, prof2), 2) 
     124   pr1=strtrim(string(format=fmt_bt, vert1), 2) 
     125   pr2=strtrim(string(format=fmt_bt, vert2), 2) 
    162126;------------------------------------------------------------ 
    163127; gestion de la date 
     
    173137   case coupe of 
    174138      'xy':begin           
    175          if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept 
    176          if n_elements(gdep) GE 2 then begin 
    177             IF gdep[0] LT gdep[1] THEN niveautest = 1 ELSE niveautest = jpk 
    178          ENDIF ELSE niveautest = 1  
    179          if niveau NE niveautest AND (strpos(direc, 'z') EQ -1 OR nz EQ 1) then BEGIN 
    180             prof=strtrim(round(gdep[niveau-1]), 1) 
    181             !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 
    182          ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 
    183          !x.title = 'Longitude' 
    184          !y.title = 'Latitude' 
     139        if strupcase(vargrid) EQ 'W' then firstz = firstzw $ 
     140        ELSE firstz = firstzt 
     141        if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN 
     142          prof = strtrim(round(gdep[0]), 1) 
     143          !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 
     144        ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 
     145        !x.title = lontitle 
     146        !y.title = lattitle 
    185147      end 
    186148 
     
    191153          !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    192154          !p.title = zonalf+varexp+datef+svardate+fieldf+varname 
    193          !x.title = 'Longitude' 
    194          if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 
     155         !x.title = lontitle 
     156         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     157           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 
     158         ENDIF 
    195159         !y.title = depthf2 
    196160      end 
     
    203167          !p.title = meridf+varexp+datef+svardate+fieldf+varname 
    204168         !y.title = vertz 
    205          !x.title = 'Latitude' 
    206          if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 
     169         !x.title = lattitle 
     170         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     171           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 
     172         ENDIF 
    207173      end 
    208174 
     
    213179         !p.title  =     hovxt+varexp+fieldf+varname 
    214180         IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef 
    215          !x.title = 'Longitude' 
    216          if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 
     181         !x.title = lontitle 
     182         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     183           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 
     184         ENDIF 
    217185      end 
    218186 
     
    223191         !p.title  =     hovyt+varexp+fieldf+varname 
    224192         IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
    225          !y.title = 'Latitude' 
    226          if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 
     193         !y.title = lattitle 
     194         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     195           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 
     196         ENDIF 
    227197      end 
    228198 
     
    246216          !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    247217         !p.title  =            varexp+datef+svardate+fieldf+varname 
    248          !x.title = 'Longitude' 
    249          if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 
     218         !x.title = lontitle 
     219         if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     220           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 
     221         ENDIF 
    250222         !y.title = varname 
    251223      end 
     
    255227          !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    256228         !p.title  =            varexp+datef+svardate+fieldf+varname 
    257          !x.title = 'Latitude' 
    258          if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 
     229         !x.title = lattitle 
     230         if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     231           IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 
     232         ENDIF 
    259233         !y.title = varname 
    260234      end 
  • trunk/ToBeReviewed/PLOTS/style.pro

    r41 r42  
    109109; trait continu gras pour 0 
    110110         seuil = 1.e-6 
    111          thick=replicate(.1,  n_elements(level_z2d)) 
     111         thick=replicate(.5,  n_elements(level_z2d)) 
    112112         linestyle=[0] 
    113113         rien=where(abs(level_z2d)/max(abs(level_z2d)) LT seuil) 
    114          if rien[0] NE -1 then thick[rien[0]] = 2 
     114         if rien[0] NE -1 then thick[rien[0]] = 3 
    115115      end 
    116116      else: begin 
Note: See TracChangeset for help on using the changeset viewer.