Changeset 152


Ignore:
Timestamp:
08/10/06 09:01:35 (18 years ago)
Author:
smasson
Message:

introduce pltv.pro

Location:
trunk/SRC
Files:
1 added
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Grid/changemsk.pro

    r124 r152  
    4242   ELSE cellsize = long(2) 
    4343   window,xsize=taille[1]*cellsize,ysize=taille[2]*cellsize 
    44    tvscl, congridseb(newmsk, taille[1]*cellsize, taille[2]*cellsize) 
     44   tvscl, congrid(newmsk, taille[1]*cellsize, taille[2]*cellsize) 
    4545 
    4646   if NOT keyword_set(nouseinfos) then begin 
  • trunk/SRC/Obsolete/congridseb.pro

    r151 r152  
    44;+ 
    55; @file_comments 
    6 ; Like congrid but here, it works... 
    7 ;        example: 
     6; 
     7; Used to avoid a bug in congrid in a old version of IDL 
     8; Useless now... 
     9; 
     10; old example: based on a old version of IDL (5.??) 
    811; IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) 
    912;       1 1 1 2 2 2 3 3 3 3 4 4 
     
    2225;       5 5 5 6 6 6 7 7 7 8 8 8 
    2326; 
    24 ; @categories utilities 
     27; @obsolete 
    2528; 
    26 ; @param tableau {in}{required} 
    27 ; A table 1 ou 2d 
     29; @param arr {in}{required} 
     30; 1 or 2d array 
    2831; 
    2932; @param x {in}{required} 
    30 ; dimension in x of the result which must be 
    31 ; a multiple of the dimension in x of the table. 
     33; first dimension of the result which must be 
     34; a multiple of the first dimension of the input array. 
    3235; 
    3336; @param y {in}{required} 
    34 ; dimension in y of the result which must be 
    35 ; a multiple of the dimension in y of the table. 
     37; second dimension of the result which must be 
     38; a multiple of the second dimension of the input array 
    3639; 
    3740; @returns 
    38 ; a table dim x * y 
     41; an array which dimensions are x,y 
    3942; 
    4043; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 
     
    5255  compile_opt idl2, strictarrsubs 
    5356; 
    54    res=tableau 
    55    taille = size(tableau) 
    5657   CASE N_PARAMS() OF 
    57       2: begin 
    58          res=replicate(1,1.*x/taille[1])#res[*] 
    59          return, res[*] 
    60       end 
    61       3: begin 
    62          res = transpose(res) 
    63          res = replicate(1, 1.*y/taille[2])#res[*] 
    64          res = reform(res, y, taille[1], /over) 
    65          res = transpose(res) 
    66          res = replicate(1, 1.*x/taille[1])#res[*] 
    67         return, reform(res, x,y, /overwrite) 
    68       end 
    69       else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB') 
     58      2: return, congrid(tableau, x) 
     59      3:return, congrid(tableau, x, y) 
     60      else: return, report('Bad number or arguments in the call of congridseb') 
    7061   endcase 
    7162end 
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt.pro

    r142 r152  
    55; 
    66; @file_comments  
    7 ; Draw horizontal graph (map) 
     7; Draw horizontal graph (map) with CONTOUR procedure 
    88; 
    99; @categories  
     
    1111; 
    1212; @param TAB1 {in}{required}  
    13 ; The field whose we want to make the horizontal map can be 2 kind of thing: 
     13; The field whose we want to make the horizontal map can be: 
    1414;         1) an array. if needed, its mean along the z and t direction 
    1515;         will be automatically performed. 
     
    120120; 
    121121; @keyword MAXIN  
    122 ; Allows to specify the max value we want to consider in the drawing of contour  
    123 ; helping by the keyword instead of the argument max. If the argument and the keyword are  
    124 ; specified in the same time, it is the value specified by the keyword which is retained. 
     122; to specify the max value we want to plot with a keyword instead of with the 
     123; input parameter max. If max is defined by both, parameter and keyword, the 
     124; keyword is retained. 
    125125; 
    126126; @keyword MININ  
    127 ; Allows to specify the min value we want to consider in the drawing of contour  
    128 ; helping by the keyword instead of the argument min. If the argument and the keyword are  
    129 ; specified in the same time, it is the value specified by the keyword which is retained. 
     127; to specify the min value we want to plot with a keyword instead of with the 
     128; input parameter min. If min is defined by both, parameter and keyword, the 
     129; keyword is retained. 
    130130; 
    131131; @keyword NLEVEL  
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro

    r142 r152  
    115115; 
    116116; @keyword MAXIN  
    117 ; Allows to specify the max value we want to consider in the drawing of contour  
    118 ; helping by the keyword instead of the argument max. If the argument and the keyword are  
    119 ; specified in the same time, it is the value specified by the keyword which is retained. 
     117; to specify the max value we want to plot with a keyword instead of with the 
     118; input parameter max. If max is defined by both, parameter and keyword, the 
     119; keyword is retained. 
    120120; 
    121121; @keyword MININ  
    122 ; Allows to specify the min value we want to consider in the drawing of contour  
    123 ; helping by the keyword instead of the argument min. If the argument and the keyword are  
    124 ; specified in the same time, it is the value specified by the keyword which is retained. 
     122; to specify the min value we want to plot with a keyword instead of with the 
     123; input parameter min. If min is defined by both, parameter and keyword, the 
     124; keyword is retained. 
    125125; 
    126126; @keyword NLEVEL  
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro

    r142 r152  
    9797; 
    9898; @keyword MAXIN  
    99 ; Allows to specify the max value we want to consider in the drawing of contour  
    100 ; helping by the keyword instead of the argument max. If the argument and the keyword are  
    101 ; specified in the same time, it is the value specified by the keyword which is retained. 
     99; to specify the max value we want to plot with a keyword instead of with the 
     100; input parameter max. If max is defined by both, parameter and keyword, the 
     101; keyword is retained. 
    102102; 
    103103; @keyword MININ  
    104 ; Allows to specify the min value we want to consider in the drawing of contour  
    105 ; helping by the keyword instead of the argument min. If the argument and the keyword are  
    106 ; specified in the same time, it is the value specified by the keyword which is retained. 
     104; to specify the min value we want to plot with a keyword instead of with the 
     105; input parameter min. If min is defined by both, parameter and keyword, the 
     106; keyword is retained. 
    107107; 
    108108; @keyword NLEVEL  
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/tvplus.pro

    r142 r152  
    2424; are not coded for "scrolling window" case... 
    2525; 
    26 ; @keyword BOTTOM 
    27 ; The lowest color index of the colors to be loaded in 
    28 ; the bar. default is 0. 
    29 ; 
    30 ; @keyword C_NAN 
     26; @keyword BOTTOM {default=1} 
     27; The lowest color index of the colors to be used 
     28; 
     29; @keyword C_NAN {default=!d.n_colors < 255} 
    3130; The color number that should be used for the NaN values. 
    32 ; default value is !d.n_colors < 255 
    33 ; 
    34 ; @keyword C_MASK 
     31; 
     32; @keyword C_MASK {default=0} 
    3533; The color number that should be used for the mask values. 
    36 ; default value is 0 
    3734; 
    3835; @keyword OFFSET  
     
    4744; abs(mask)/10. This is necessary to avoid the rounding errors 
    4845; 
    49 ; @keyword MIN  
    50 ; Scalar used to specify the min value of the color bar. default is 0 
     46; @keyword MIN 
     47; Scalar used to specify the min value to be drawn. 
    5148; 
    5249; @keyword MAX 
    53 ; Scalar used to specify the max value of the color bar. default is !d.n_colors < 255 
    54 ; 
    55 ; @keyword NCOLORS 
    56 ; This is the number of colors in the color bar. default is !d.n_colors<255 -1 
     50; Scalar used to specify the max value to be drawn. 
     51; 
     52; @keyword NCOLORS {default=(d.n_colors < 256) - 1 - bottom} 
     53; number of colors to be used. 
    5754; 
    5855; @keyword NOINTERP 
    5956; Used this keyword if you don't whant that the values 
    60 ; are interpolated between 0 (or min) and !d.n_colors < 255 (or max). 
     57; are interpolated from BOTTOM using NCOLORS colors. 
    6158; This can be for example usefull when working on byte type arrays. 
    6259; 
     
    6865; default is window number 0. 
    6966; 
     67; @keyword _EXTRA 
     68; used to pass keywords to TV, PLOT, COLORBAR 
     69;  
    7070; @restrictions  
    7171; use your mouse to scan the array values... 
     
    112112;------------------------------------------------------------ 
    113113  ncolmax = !d.n_colors < 256 
    114   IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 0 
    115   if NOT keyword_set(ncolors) then ncolors = ncolmax-bottom 
     114  IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 1 
     115  if NOT keyword_set(ncolors) then ncolors = ncolmax - 1 - bottom 
    116116  topcol = (bottom+ncolors-1) < (ncolmax-1) 
    117117;------------------------------------------------------------ 
     
    177177    m = 1.*(ncolors-1)/(truemax-truemin) 
    178178    p = bottom-1.*truemin*m 
    179     arr = round(1.*m*arr+p)  
     179    arr = round(m*temporary(arr)+p)  
    180180  endif 
    181181; set c_nan for NaN values  
     
    188188    arr[masked] = c_mask < (ncolmax -1) 
    189189; use byte type to save memory 
    190   arr = byte(arr) 
     190  arr = byte(temporary(arr)) 
    191191; increase the size of the array in order to be displayed 
    192192; with the suitable size  
    193   arr = congridseb(arr, (size(arr))[1]*cellsize, (size(arr))[2]*cellsize) 
     193  szarr = size(arr, /dimensions) 
     194  arr = congrid(temporary(arr), szarr[0]*cellsize, szarr[1]*cellsize) 
    194195;------------------------------------------------------------ 
    195196; open a window with the correct size 
  • trunk/SRC/ToBeReviewed/PLOTS/DIVERS/barrecouleur.pro

    r142 r152  
    2727                  , NOCOLORBAR = nocolorbar, CB_TITLE = cb_title $ 
    2828                  , NOFILL = nofill, COLOR_c = color_c $ 
    29                   , min = min, max = max, divisions = divisions $ 
     29                  , MIN = min, MAX = max, divisions = divisions $ 
    3030                  , CB_SUBTITLE = cb_subtitle, POST = post, _extra = ex 
    3131;------------------------------------------------------------ 
  • trunk/SRC/ToBeReviewed/PLOTS/axe.pro

    r142 r152  
    172172;-------------------------------------------------------------- 
    173173   case coupe of 
     174      'pltv':BEGIN  
     175        dtasize = tempsmin 
     176         !x.range = [-0.5, dtasize[0] - 0.5] 
     177         !y.range = [-0.5, dtasize[1] - 0.5]  
     178         if keyword_set(reverse_x) then !x.range=reverse(!x.range) 
     179         if keyword_set(reverse_y) then !y.range=reverse(!y.range) 
     180         !x.title = 'nx' 
     181         !y.title = 'ny' 
     182      END 
    174183      'xy':BEGIN  
    175184         if keyword_set(reverse_x) then !x.range=[lon2,lon1] ELSE !x.range=[lon1,lon2] 
  • trunk/SRC/ToBeReviewed/PLOTS/legende.pro

    r142 r152  
    4949;------------------------------------------------------------ 
    5050;------------------------------------------------------------ 
    51 pro legende,mi,ma,coupe,CONTOUR = contour,ENDPOINTS = endpoints, DIREC = direc $ 
    52             , VECTLEGENDE = vectlegende $ 
    53             , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $ 
    54             , NPTS = npts, _EXTRA = ex 
     51pro legende, mi, ma, coupe, CONTOUR = contour, ENDPOINTS = endpoints, DIREC = direc $ 
     52             , VECTLEGENDE = vectlegende $ 
     53             , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $ 
     54             , NPTS = npts, _EXTRA = ex 
    5555; 
    5656  compile_opt idl2, strictarrsubs 
    5757; 
    5858@common 
    59    tempsun = systime(1)         ; pour key_performance 
    60 ;------------------------------------------------------------ 
    61    grille, -1, -1, -1, gdep, nx, ny, nz 
     59  tempsun = systime(1)          ; pour key_performance 
     60;------------------------------------------------------------ 
     61  grille, -1, -1, -1, gdep, nx, ny, nz 
    6262; 
    6363; English legends 
    6464; 
    65    fmt_mm = '(f12.2)' 
    66    fmt_bt = '(f7.1)' 
    67    colorf = '' 
    68    contourf = 'Contour plot,' 
    69    vecteurf = 'Vector norm  ' 
    70    expf = '' 
    71    datef = '   ' 
    72    fieldf = '   ' 
    73    depthf = '   ' 
    74    endpointsf = 'Diag. Section' 
    75    zonalf = '' 
    76    IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in ' 
    77    timintf = 'time in ' 
    78    onf = ' - ' 
    79    depthf2 = 'Depth (m)' 
    80    Meridf = 'Zonal Mean  ' 
    81    IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in ' 
    82    hovxt = 'XT-plot   ' 
    83    diaghovxt = 'Diag. XT-plot   ' 
    84    depintf = 'depths in ' 
    85    timef = 'Time' 
    86    hovyt = 'YT-plot   ' 
    87    diaghovyt = 'Diag. YT-plot   ' 
    88    hovzt = 'ZT-plot   ' 
    89    hovt = '' 
    90    IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index' 
    91    IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index' 
    92     
    93    vertz = depthf2 
    94    legniv = ' m' 
    95    IF keyword_set(TYPE_YZ) THEN BEGIN 
    96      IF type_yz EQ 'hPa' THEN vertz = 'hPa'  
    97      IF type_yz EQ 'hPa' THEN legniv = ' hPa'  
    98    ENDIF  
     65  fmt_mm = '(f12.2)' 
     66  fmt_bt = '(f7.1)' 
     67  colorf = '' 
     68  contourf = 'Contour plot,' 
     69  vecteurf = 'Vector norm  ' 
     70  expf = '' 
     71  datef = '   ' 
     72  fieldf = '   ' 
     73  depthf = '   ' 
     74  endpointsf = 'Diag. Section' 
     75  zonalf = '' 
     76  IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in ' 
     77  timintf = 'time in ' 
     78  onf = ' - ' 
     79  depthf2 = 'Depth (m)' 
     80  Meridf = 'Zonal Mean  ' 
     81  IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in ' 
     82  hovxt = 'XT-plot   ' 
     83  diaghovxt = 'Diag. XT-plot   ' 
     84  depintf = 'depths in ' 
     85  timef = 'Time' 
     86  hovyt = 'YT-plot   ' 
     87  diaghovyt = 'Diag. YT-plot   ' 
     88  hovzt = 'ZT-plot   ' 
     89  hovt = '' 
     90  IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index' 
     91  IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index' 
     92   
     93  vertz = depthf2 
     94  legniv = ' m' 
     95  IF keyword_set(TYPE_YZ) THEN BEGIN 
     96    IF type_yz EQ 'hPa' THEN vertz = 'hPa'  
     97    IF type_yz EQ 'hPa' THEN legniv = ' hPa'  
     98  ENDIF  
    9999; 
    100100; Start legende 
     
    103103; definition and possible complement of !p.subtitle 
    104104;------------------------------------------------------------ 
    105    if n_elements(varunit) ne 0 then unite='('+varunit+')' else unite='' 
    106    !p.subtitle=colorf+unite+': Min= '+strtrim(string(format=fmt_mm,mi), 2)$ 
    107     +', Max= '+strtrim(string(format=fmt_mm,ma), 2) 
    108    if keyword_set(intervalle) then BEGIN 
    109       if intervalle NE -1 then $ 
    110        !p.subtitle=!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,intervalle), 2) 
    111    endif 
    112    if size(contour, /type) EQ 8 then BEGIN ; it is a structure  
    113       unite='('+contour.(1)+')' 
    114       !p.subtitle=!p.subtitle+'!C '+contourf+unite $ 
    115        +': Min= '+strtrim(string(format=fmt_mm,contour.(0)[0]), 2)$ 
    116        +', Max= '+strtrim(string(format=fmt_mm,contour.(0)[1]), 2) 
    117       if contour.inter NE -1  then $ 
    118        !p.subtitle=!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,contour.inter), 2) 
    119    ENDIF 
    120    if size(vectlegende, /type) EQ 8  then begin 
    121       unite='('+vectlegende.(1)+')' 
    122       !p.subtitle=!p.subtitle+'!C '+vecteurf+unite $ 
    123        +': Min= '+strtrim(string(format=fmt_mm,vectlegende.(0)[0]), 2)$ 
    124        +', Max= '+strtrim(string(format=fmt_mm,vectlegende.(0)[1]), 2) 
    125    endif 
     105  if n_elements(varunit) ne 0 then unite = '('+varunit+')' else unite = '' 
     106  !p.subtitle = colorf+unite+': Min= '+strtrim(string(format = fmt_mm, mi), 2)$ 
     107                +', Max= '+strtrim(string(format = fmt_mm, ma), 2) 
     108  if keyword_set(intervalle) then BEGIN 
     109    if intervalle NE -1 then $ 
     110       !p.subtitle = !p.subtitle+', Int= '+strtrim(string(format = fmt_mm, intervalle), 2) 
     111  endif 
     112  if size(contour, /type) EQ 8 then BEGIN ; it is a structure  
     113    unite = '('+contour.(1)+')' 
     114    !p.subtitle = !p.subtitle+'!C '+contourf+unite $ 
     115                  +': Min= '+strtrim(string(format = fmt_mm, contour.(0)[0]), 2)$ 
     116                  +', Max= '+strtrim(string(format = fmt_mm, contour.(0)[1]), 2) 
     117    if contour.inter NE -1  then $ 
     118       !p.subtitle = !p.subtitle+', Int= '+strtrim(string(format = fmt_mm, contour.inter), 2) 
     119  ENDIF 
     120  if size(vectlegende, /type) EQ 8  then begin 
     121    unite = '('+vectlegende.(1)+')' 
     122    !p.subtitle = !p.subtitle+'!C '+vecteurf+unite $ 
     123                  +': Min= '+strtrim(string(format = fmt_mm, vectlegende.(0)[0]), 2)$ 
     124                  +', Max= '+strtrim(string(format = fmt_mm, vectlegende.(0)[1]), 2) 
     125  endif 
    126126;------------------------------------------------------------ 
    127127; Shapping of subdomain 's dimensions 
    128128;------------------------------------------------------------   
    129   la1=strtrim(string(format=fmt_bt, lat1), 2) 
    130    la2=strtrim(string(format=fmt_bt, lat2), 2) 
    131    lo1=strtrim(string(format=fmt_bt, lon1), 2) 
    132    lo2=strtrim(string(format=fmt_bt, lon2), 2) 
    133    pr1=strtrim(string(format=fmt_bt, vert1), 2) 
    134    pr2=strtrim(string(format=fmt_bt, vert2), 2) 
     129  la1 = strtrim(string(format = fmt_bt, lat1), 2) 
     130  la2 = strtrim(string(format = fmt_bt, lat2), 2) 
     131  lo1 = strtrim(string(format = fmt_bt, lon1), 2) 
     132  lo2 = strtrim(string(format = fmt_bt, lon2), 2) 
     133  pr1 = strtrim(string(format = fmt_bt, vert1), 2) 
     134  pr2 = strtrim(string(format = fmt_bt, vert2), 2) 
    135135;------------------------------------------------------------ 
    136136; Management of the date 
    137137;------------------------------------------------------------   
    138  if n_elements(vardate) EQ 0 then vardate = '' 
    139    if NOT keyword_set(direc) then direc = '' 
    140    if strpos(direc, 't') NE -1 then begin 
    141       svardate = strtrim(vairdate(time[0]), 1)+' - '+strtrim(vairdate(time[jpt-1]), 1) 
    142    ENDIF ELSE svardate = vardate 
     138  if n_elements(vardate) EQ 0 then vardate = '' 
     139  if NOT keyword_set(direc) then direc = '' 
     140  if strpos(direc, 't') NE -1 then begin 
     141    svardate = strtrim(vairdate(time[0]), 1)+' - '+strtrim(vairdate(time[jpt-1]), 1) 
     142  ENDIF ELSE svardate = vardate 
    143143;------------------------------------------------------------ 
    144144; case on the caes where the caption is applied 
    145145;------------------------------------------------------------    
    146    case coupe of 
    147       'xy':begin           
    148         if strupcase(vargrid) EQ 'W' then firstz = firstzw $ 
    149         ELSE firstz = firstzt 
    150         if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN 
    151           prof = strtrim(round(gdep[0]), 1) 
    152           !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 
    153         ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 
    154         !x.title = lontitle 
    155         !y.title = lattitle 
    156       end 
    157  
    158       'xz':begin 
    159          IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny, 1) 
    160          IF long(n) LE 3 THEN zonalf = 'Section   ' 
    161          if keyword_set(endpoints) AND lat1 NE lat2 then $ 
    162           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    163           !p.title = zonalf+varexp+datef+svardate+fieldf+varname 
    164          !x.title = lontitle 
    165          if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
    166            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) 
    167          ENDIF 
    168          !y.title = depthf2 
    169       end 
    170  
    171       'yz':begin 
    172          IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx, 1) 
    173          IF long(n) LE 3 THEN meridf = '' 
    174          if keyword_set(endpoints) AND lon1 NE lon2 then $ 
    175           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    176           !p.title = meridf+varexp+datef+svardate+fieldf+varname 
    177          !y.title = vertz 
    178          !x.title = lattitle 
    179          if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
    180            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) 
    181          ENDIF 
    182       end 
    183  
    184       'xt':begin 
     146  case coupe of 
     147    'xy':begin           
     148      if strupcase(vargrid) EQ 'W' then firstz = firstzw $ 
     149      ELSE firstz = firstzt 
     150      if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN 
     151        prof = strtrim(round(gdep[0]), 1) 
     152        !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 
     153      ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 
     154      !x.title = lontitle 
     155      !y.title = lattitle 
     156    end 
     157 
     158    'xz':begin 
     159      IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n = strtrim(ny, 1) 
     160      IF long(n) LE 3 THEN zonalf = 'Section   ' 
     161      if keyword_set(endpoints) AND lat1 NE lat2 then $ 
     162         !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
     163            !p.title = zonalf+varexp+datef+svardate+fieldf+varname 
     164      !x.title = lontitle 
     165      if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     166        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) 
     167      ENDIF 
     168      !y.title = depthf2 
     169    end 
     170 
     171    'yz':begin 
     172      IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n = strtrim(nx, 1) 
     173      IF long(n) LE 3 THEN meridf = '' 
     174      if keyword_set(endpoints) AND lon1 NE lon2 then $ 
     175         !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
     176            !p.title = meridf+varexp+datef+svardate+fieldf+varname 
     177      !y.title = vertz 
     178      !x.title = lattitle 
     179      if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     180        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) 
     181      ENDIF 
     182    end 
     183 
     184    'xt':begin 
    185185;         IF keyword_set(npts) THEN n = strtrim(npts, 1) 
    186          if keyword_set(endpoints) AND lat1 NE lat2 then $ 
    187           !p.title = diaghovxt+varexp+fieldf+varname ELSE $ 
    188          !p.title  =     hovxt+varexp+fieldf+varname 
    189          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef 
    190          !x.title = lontitle 
    191          if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
    192            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) 
    193          ENDIF 
    194       end 
    195  
    196       'yt':begin 
     186      if keyword_set(endpoints) AND lat1 NE lat2 then $ 
     187         !p.title = diaghovxt+varexp+fieldf+varname ELSE $ 
     188            !p.title  =     hovxt+varexp+fieldf+varname 
     189      IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef 
     190      !x.title = lontitle 
     191      if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     192        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) 
     193      ENDIF 
     194    end 
     195 
     196    'yt':begin 
    197197;         IF keyword_set(npts) THEN n = strtrim(npts, 1)  
    198          if keyword_set(endpoints) AND lon1 NE lon2 then $ 
    199           !p.title = diaghovyt+varexp+fieldf+varname ELSE $ 
    200          !p.title  =     hovyt+varexp+fieldf+varname 
    201          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
    202          !y.title = lattitle 
    203          if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
    204            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) 
    205          ENDIF 
    206       end 
    207  
    208       'zt':begin 
     198      if keyword_set(endpoints) AND lon1 NE lon2 then $ 
     199         !p.title = diaghovyt+varexp+fieldf+varname ELSE $ 
     200            !p.title  =     hovyt+varexp+fieldf+varname 
     201      IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
     202      !y.title = lattitle 
     203      if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     204        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) 
     205      ENDIF 
     206    end 
     207 
     208    'zt':begin 
    209209;         IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1) 
    210          !p.title = hovzt+varexp+fieldf+varname 
    211          !y.title = depthf2 
    212          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
    213       end 
    214       't':begin 
     210      !p.title = hovzt+varexp+fieldf+varname 
     211      !y.title = depthf2 
     212      IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
     213    end 
     214    't':begin 
    215215;         IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE BEGIN  
    216216;            if keyword_set(integration3d) then n=strtrim(nx*ny*nz, 1) ELSE n=strtrim(nx*ny, 1) 
    217217;         ENDELSE  
    218          !p.title = hovt+varexp+fieldf+varname 
    219          !y.title = varname 
    220          IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
    221       end 
    222       'x':begin             
     218      !p.title = hovt+varexp+fieldf+varname 
     219      !y.title = varname 
     220      IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 
     221    end 
     222    'x':begin             
    223223;         IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny*nz, 1) 
    224          if keyword_set(endpoints) AND lat1 NE lat2 then $ 
    225           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    226          !p.title  =            varexp+datef+svardate+fieldf+varname 
    227          !x.title = lontitle 
    228          if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
    229            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) 
    230          ENDIF 
    231          !y.title = varname 
    232       end 
    233       'y':begin             
     224      if keyword_set(endpoints) AND lat1 NE lat2 then $ 
     225         !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
     226            !p.title  =            varexp+datef+svardate+fieldf+varname 
     227      !x.title = lontitle 
     228      if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN  
     229        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) 
     230      ENDIF 
     231      !y.title = varname 
     232    end 
     233    'y':begin             
    234234;         IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*nz, 1) 
    235          if keyword_set(endpoints) AND lon1 NE lon2 then $ 
    236           !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
    237          !p.title  =            varexp+datef+svardate+fieldf+varname 
    238          !x.title = lattitle 
    239          if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
    240            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) 
    241          ENDIF 
    242          !y.title = varname 
    243       end 
    244       'z':begin 
    245          IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1) 
    246          !p.title = varexp+datef+svardate+fieldf+varname 
    247          !y.title = depthf2 
    248          !x.title = varname 
    249       end 
    250       'yfx': BEGIN 
    251          IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny*nz, 1) 
    252          !p.title = varexp+datef+svardate+varunit 
    253          !x.title = varname2 
    254          !y.title = varname 
    255       END  
    256       else: 
    257    ENDCASE 
    258    if keyword_set(direc) then BEGIN 
    259       if strpos(direc, 'x') NE -1 then $ 
     235      if keyword_set(endpoints) AND lon1 NE lon2 then $ 
     236         !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 
     237            !p.title  =            varexp+datef+svardate+fieldf+varname 
     238      !x.title = lattitle 
     239      if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN  
     240        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) 
     241      ENDIF 
     242      !y.title = varname 
     243    end 
     244    'z':begin 
     245      IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n = strtrim(nx*ny, 1) 
     246      !p.title = varexp+datef+svardate+fieldf+varname 
     247      !y.title = depthf2 
     248      !x.title = varname 
     249    end 
     250    'yfx': BEGIN 
     251      IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n = strtrim(nx*ny*nz, 1) 
     252      !p.title = varexp+datef+svardate+varunit 
     253      !x.title = varname2 
     254      !y.title = varname 
     255    END  
     256    else: 
     257  ENDCASE 
     258  if keyword_set(direc) then BEGIN 
     259    if strpos(direc, 'x') NE -1 then $ 
    260260       !p.subtitle = lonintf+'['+lo1+', '+lo2+']'+onf+'('+strtrim(nx, 1)+' points)  !C' +!p.subtitle 
    261       if strpos(direc, 'y') NE -1 then BEGIN 
    262          if strpos(!p.subtitle, '[') EQ -1 then $ 
    263           !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points)  !C'+!p.subtitle $ 
    264          ELSE !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points)  '+!p.subtitle 
    265       ENDIF 
    266       if strpos(direc, 'z') NE -1 AND (nz NE 1 OR coupe NE 'xy') then BEGIN  
    267          if strpos(!p.subtitle, '[') EQ -1 then $ 
    268           !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points)  !C'+!p.subtitle $ 
    269          ELSE !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points)  '+!p.subtitle 
    270       ENDIF 
    271    ENDIF 
    272    if keyword_set(endpoints) AND coupe NE 'yt' AND lat1 NE lat2 then !p.title = !p.title+'!C!C' 
    273     
    274    if keyword_set(key_performance) THEN print, 'temps legende', systime(1)-tempsun  
    275    return 
     261    if strpos(direc, 'y') NE -1 then BEGIN 
     262      if strpos(!p.subtitle, '[') EQ -1 then $ 
     263         !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points)  !C'+!p.subtitle $ 
     264      ELSE !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points)  '+!p.subtitle 
     265    ENDIF 
     266    if strpos(direc, 'z') NE -1 AND (nz NE 1 OR coupe NE 'xy') then BEGIN  
     267      if strpos(!p.subtitle, '[') EQ -1 then $ 
     268         !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points)  !C'+!p.subtitle $ 
     269      ELSE !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points)  '+!p.subtitle 
     270    ENDIF 
     271  ENDIF 
     272  if keyword_set(endpoints) AND coupe NE 'yt' AND lat1 NE lat2 then !p.title = !p.title+'!C!C' 
     273   
     274  if keyword_set(key_performance) THEN print, 'temps legende', systime(1)-tempsun  
     275  return 
    276276end 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro

    r150 r152  
    6464  ELSE type = widget_info(actionid, /combobox_gettext) 
    6565  case type of 
    66     'plt':procedure = 'plt' 
    67     'pltz':procedure = 'pltz' 
    6866    'pltz diag up':procedure = 'pltz' 
    6967    'pltz diag dn':procedure = 'pltz' 
    70     'pltt':procedure = 'pltt' 
    7168    'pltt diag up':procedure = 'pltt' 
    7269    'pltt diag dn':procedure = 'pltt' 
     
    8178    'z':procedure = 'plt1d' 
    8279    't':procedure = 'pltt' 
     80    ELSE:procedure = type 
    8381  endcase 
    8482; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro

    r150 r152  
    5757  !y = (extractatt(top_uvalue, 'yenvs'))[numdessin] 
    5858;------------------------------------------------------------ 
     59  actionid = widget_info(event.top, find_by_uname = 'action') 
     60  type = widget_info(actionid, /combobox_gettext) 
     61;------------------------------------------------------------ 
    5962; Change the domain box: 
    6063;------------------------------------------------------------ 
     
    6366  y = [coor[1, 0], coor[1, 1]] 
    6467  domainid = widget_info(event.top, find_by_uname = 'domain') 
    65   boxzoom = [x, y] 
     68  IF type EQ 'pltv' THEN BEGIN  
     69    currentfile = extractatt(top_uvalue, 'currentfile') 
     70    listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid 
     71    listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar 
     72    vlstid = widget_info(event.top, find_by_uname = 'varlist') 
     73    namevar = widget_info(vlstid, /combobox_gettext) 
     74    indexvar = where(listvar EQ namevar) 
     75    vargrid = strupcase(listgrid[indexvar]) 
     76    grille, -1, glam, gphi 
     77    boxzoom = [glam[x[0], y[0]], glam[x[1], y[1]], gphi[x[0], y[0]], gphi[x[1], y[1]]] 
     78  ENDIF ELSE boxzoom = [x, y] 
    6679; Do we have to pass the boxzoom in indexes ??? 
    6780  currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 
     
    88101  widget_control, domainid, set_value = boxzoom 
    89102; 
    90 ;------------------------------------------------------------ 
    91   actionid = widget_info(event.top, find_by_uname = 'action') 
    92   type = widget_info(actionid, /combobox_gettext) 
    93103  case uval.press of 
    94104    1:BEGIN 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.pro

    r150 r152  
    2525    'datafilename':BEGIN 
    2626      widget_control, event.id, get_value = filename 
    27       filename = isafile(filename = filename[0], iodir = iodir, /onlync, title = 'data file name') 
     27      filename = isafile(filename = filename[0], /onlync $ 
     28                         , title = 'data file name', /tryfind, /fully_qualify_path) 
    2829      if size(filename, /type) NE 7 then BEGIN  
    2930        widget_control, event.id, set_value = '' 
     
    3334    END 
    3435    'browse datafilename':BEGIN 
    35       filename = isafile(iodir = iodir, /onlync, title = 'data file name') 
     36      filename = isafile(/onlync, title = 'data file name', /tryfind, /fully_qualify_path) 
    3637      if size(filename, /type) NE 7 then return 
    3738      widget_control, widget_info(event.handler, find_by_uname = 'datafilename') $ 
     
    102103      datafilename = datafilename[0] 
    103104      IF datafilename EQ '' THEN return 
    104       datafilename = isafile(filename = datafilename, iodir = iodir, /onlync, title = 'data file name') 
     105      datafilename = isafile(filename = datafilename, /tryfind, /onlync $ 
     106                             , title = 'data file name', /fully_qualify_path) 
    105107      if size(datafilename, /type) NE 7 then BEGIN  
    106108        widget_control, widget_info(event.handler, find_by_uname = 'datafilename') $ 
     
    266268          , izmindta:izmindta, izmaxdta:izmaxdta} 
    267269 
    268   res3 = scanfile(res.datafilename, iodir = iodir, _extra = ex) 
     270  res3 = scanfile(res.datafilename, _extra = ex) 
    269271  if size(res3, /type) NE 8 then return,  -1 
    270272 
  • trunk/SRC/ToBeReviewed/WIDGET/xxx.pro

    r150 r152  
    229229  xoff = 0 
    230230  yoff = 0 
    231   pltlst = ['plt' $ 
     231  pltlst = ['plt', 'pltv' $ 
    232232            , 'pltz', 'pltz diag up', 'pltz diag dn' $ 
    233233            , 'pltt', 'pltt diag up', 'pltt diag dn' $ 
  • trunk/SRC/Utilities/find.pro

    r136 r152  
    2424; activate this keyword to stop looking for the file as soon as we found one. 
    2525; 
    26 ; @keyword IODIRECTORY {default=!path}  
     26; @keyword IODIRECTORY {default=['.',!path]}  
    2727; A scalar or array variable of string type, containing 
    2828; directories names where we are looking for the file. 
     
    3434; 
    3535; @keyword LOOKALLDIR  
    36 ; activate to look for the file with a recursive search 
    37 ; in iodir, homedir, !path + the DATA:TestsData directory if it exists. 
     36; activate to look for the file (with a recursive search if needed) 
     37; in . iodir, homedir, !path + the DATA:TestsData directory if it exists. 
    3838; 
    3939; @keyword NOPRO  
     
    5656; @keyword UNIQUE  
    5757; activate to make sure that each element of the output vector is unique. 
     58; 
     59; @keyword TRYFIND  
     60; if the file was not found and this keyword is activated, find will call 
     61; itself with the keywords /LOOKALLDIR and /FIRSTFOUND to try to find 
     62; the file we are looking for. Note that if the file was found at the 
     63; first try this keyword as no effect (which is not the case with LOOKALLDIR)  
    5864; 
    5965; @keyword _EXTRA  
     
    106112               , REPERTOIRE = repertoire, NOPRO = nopro, ONLYPRO = onlypro $ 
    107113               , ONLYNC = onlync, UNIQUE = unique, FIRSTFOUND = firstfound $ 
    108                , LOOKALLDIR = LOOKALLDIR, _extra = ex 
     114               , LOOKALLDIR = LOOKALLDIR, TRYFIND = tryfind, _extra = ex 
    109115; define where we look for the file 
    110116; 
     
    114120    keyword_set(lookalldir):BEGIN 
    115121@cm_general 
    116       dirnames = [iodir, homedir, !path] 
     122      dirnames = ['./', iodir, homedir, !path] 
    117123      tstdtadir= file_dirname(find('find', /onlypro), /mark_directory) 
    118124      tstdtadir = (file_search(tstdtadir+'../../DATA/TestsData'))[0] 
     
    121127    keyword_set(iodirectory): dirnames = iodirectory 
    122128    keyword_set(repertoire): dirnames = repertoire 
    123     ELSE: dirnames = !path 
     129    ELSE: dirnames = ['./', !path] 
    124130  ENDCASE 
    125131  tmp = dirnames 
     
    164170    ENDIF 
    165171  ENDFOR 
     172 
    166173  IF n_elements(fileout) EQ 1 THEN fileout = 'NOT FOUND' $ 
    167174  ELSE fileout = fileout[1:*] 
     
    171178  ENDIF ELSE fileout = fileout[0] 
    172179; 
     180  IF keyword_set(lookalldir) AND fileout[0] EQ 'NOT FOUND' $ 
     181     AND NOT keyword_set(recursive) THEN $ 
     182        filout = find(file_basename(filein[0]), /lookalldir $ 
     183                      , /recursive, _extra = ex) 
     184; 
     185  IF keyword_set(tryfind) AND fileout[0] EQ 'NOT FOUND' THEN BEGIN 
     186    fileout = find(file_basename(filein[0]), /lookalldir, /firstfound, _extra = ex) 
     187    fileout = fileout[0] 
     188  ENDIF 
     189; 
    173190  RETURN, fileout 
    174191END 
Note: See TracChangeset for help on using the changeset viewer.