Changeset 152
- Timestamp:
- 08/10/06 09:01:35 (18 years ago)
- Location:
- trunk/SRC
- Files:
-
- 1 added
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/changemsk.pro
r124 r152 42 42 ELSE cellsize = long(2) 43 43 window,xsize=taille[1]*cellsize,ysize=taille[2]*cellsize 44 tvscl, congrid seb(newmsk, taille[1]*cellsize, taille[2]*cellsize)44 tvscl, congrid(newmsk, taille[1]*cellsize, taille[2]*cellsize) 45 45 46 46 if NOT keyword_set(nouseinfos) then begin -
trunk/SRC/Obsolete/congridseb.pro
r151 r152 4 4 ;+ 5 5 ; @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.??) 8 11 ; IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) 9 12 ; 1 1 1 2 2 2 3 3 3 3 4 4 … … 22 25 ; 5 5 5 6 6 6 7 7 7 8 8 8 23 26 ; 24 ; @ categories utilities27 ; @obsolete 25 28 ; 26 ; @param tableau{in}{required}27 ; A table 1 ou 2d29 ; @param arr {in}{required} 30 ; 1 or 2d array 28 31 ; 29 32 ; @param x {in}{required} 30 ; dimension in xof the result which must be31 ; 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. 32 35 ; 33 36 ; @param y {in}{required} 34 ; dimension in yof the result which must be35 ; 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 36 39 ; 37 40 ; @returns 38 ; a table dim x *y41 ; an array which dimensions are x,y 39 42 ; 40 43 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) … … 52 55 compile_opt idl2, strictarrsubs 53 56 ; 54 res=tableau55 taille = size(tableau)56 57 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') 70 61 endcase 71 62 end -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt.pro
r142 r152 5 5 ; 6 6 ; @file_comments 7 ; Draw horizontal graph (map) 7 ; Draw horizontal graph (map) with CONTOUR procedure 8 8 ; 9 9 ; @categories … … 11 11 ; 12 12 ; @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: 14 14 ; 1) an array. if needed, its mean along the z and t direction 15 15 ; will be automatically performed. … … 120 120 ; 121 121 ; @keyword MAXIN 122 ; Allows to specify the max value we want to consider in the drawing of contour123 ; helping by the keyword instead of the argument max. If the argument and the keyword are124 ; specified in the same time, it is the value specified by the keyword whichis 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. 125 125 ; 126 126 ; @keyword MININ 127 ; Allows to specify the min value we want to consider in the drawing of contour128 ; helping by the keyword instead of the argument min. If the argument and the keyword are129 ; specified in the same time, it is the value specified by the keyword whichis 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. 130 130 ; 131 131 ; @keyword NLEVEL -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro
r142 r152 115 115 ; 116 116 ; @keyword MAXIN 117 ; Allows to specify the max value we want to consider in the drawing of contour118 ; helping by the keyword instead of the argument max. If the argument and the keyword are119 ; specified in the same time, it is the value specified by the keyword whichis 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. 120 120 ; 121 121 ; @keyword MININ 122 ; Allows to specify the min value we want to consider in the drawing of contour123 ; helping by the keyword instead of the argument min. If the argument and the keyword are124 ; specified in the same time, it is the value specified by the keyword whichis 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. 125 125 ; 126 126 ; @keyword NLEVEL -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
r142 r152 97 97 ; 98 98 ; @keyword MAXIN 99 ; Allows to specify the max value we want to consider in the drawing of contour100 ; helping by the keyword instead of the argument max. If the argument and the keyword are101 ; specified in the same time, it is the value specified by the keyword whichis 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. 102 102 ; 103 103 ; @keyword MININ 104 ; Allows to specify the min value we want to consider in the drawing of contour105 ; helping by the keyword instead of the argument min. If the argument and the keyword are106 ; specified in the same time, it is the value specified by the keyword whichis 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. 107 107 ; 108 108 ; @keyword NLEVEL -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/tvplus.pro
r142 r152 24 24 ; are not coded for "scrolling window" case... 25 25 ; 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} 31 30 ; 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} 35 33 ; The color number that should be used for the mask values. 36 ; default value is 037 34 ; 38 35 ; @keyword OFFSET … … 47 44 ; abs(mask)/10. This is necessary to avoid the rounding errors 48 45 ; 49 ; @keyword MIN 50 ; Scalar used to specify the min value of the color bar. default is 046 ; @keyword MIN 47 ; Scalar used to specify the min value to be drawn. 51 48 ; 52 49 ; @keyword MAX 53 ; Scalar used to specify the max value of the color bar. default is !d.n_colors < 25554 ; 55 ; @keyword NCOLORS 56 ; This is the number of colors in the color bar. default is !d.n_colors<255 -150 ; 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. 57 54 ; 58 55 ; @keyword NOINTERP 59 56 ; 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. 61 58 ; This can be for example usefull when working on byte type arrays. 62 59 ; … … 68 65 ; default is window number 0. 69 66 ; 67 ; @keyword _EXTRA 68 ; used to pass keywords to TV, PLOT, COLORBAR 69 ; 70 70 ; @restrictions 71 71 ; use your mouse to scan the array values... … … 112 112 ;------------------------------------------------------------ 113 113 ncolmax = !d.n_colors < 256 114 IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 0115 if NOT keyword_set(ncolors) then ncolors = ncolmax -bottom114 IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 1 115 if NOT keyword_set(ncolors) then ncolors = ncolmax - 1 - bottom 116 116 topcol = (bottom+ncolors-1) < (ncolmax-1) 117 117 ;------------------------------------------------------------ … … 177 177 m = 1.*(ncolors-1)/(truemax-truemin) 178 178 p = bottom-1.*truemin*m 179 arr = round( 1.*m*arr+p)179 arr = round(m*temporary(arr)+p) 180 180 endif 181 181 ; set c_nan for NaN values … … 188 188 arr[masked] = c_mask < (ncolmax -1) 189 189 ; use byte type to save memory 190 arr = byte( arr)190 arr = byte(temporary(arr)) 191 191 ; increase the size of the array in order to be displayed 192 192 ; 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) 194 195 ;------------------------------------------------------------ 195 196 ; open a window with the correct size -
trunk/SRC/ToBeReviewed/PLOTS/DIVERS/barrecouleur.pro
r142 r152 27 27 , NOCOLORBAR = nocolorbar, CB_TITLE = cb_title $ 28 28 , NOFILL = nofill, COLOR_c = color_c $ 29 , min = min, max= max, divisions = divisions $29 , MIN = min, MAX = max, divisions = divisions $ 30 30 , CB_SUBTITLE = cb_subtitle, POST = post, _extra = ex 31 31 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/axe.pro
r142 r152 172 172 ;-------------------------------------------------------------- 173 173 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 174 183 'xy':BEGIN 175 184 if keyword_set(reverse_x) then !x.range=[lon2,lon1] ELSE !x.range=[lon1,lon2] -
trunk/SRC/ToBeReviewed/PLOTS/legende.pro
r142 r152 49 49 ;------------------------------------------------------------ 50 50 ;------------------------------------------------------------ 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 = ex51 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 55 55 ; 56 56 compile_opt idl2, strictarrsubs 57 57 ; 58 58 @common 59 tempsun = systime(1); pour key_performance60 ;------------------------------------------------------------ 61 59 tempsun = systime(1) ; pour key_performance 60 ;------------------------------------------------------------ 61 grille, -1, -1, -1, gdep, nx, ny, nz 62 62 ; 63 63 ; English legends 64 64 ; 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 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 99 99 ; 100 100 ; Start legende … … 103 103 ; definition and possible complement of !p.subtitle 104 104 ;------------------------------------------------------------ 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 109 110 !p.subtitle =!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,intervalle), 2)111 112 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 118 !p.subtitle =!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,contour.inter), 2)119 120 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 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 126 126 ;------------------------------------------------------------ 127 127 ; Shapping of subdomain 's dimensions 128 128 ;------------------------------------------------------------ 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) 135 135 ;------------------------------------------------------------ 136 136 ; Management of the date 137 137 ;------------------------------------------------------------ 138 if n_elements(vardate) EQ 0 then vardate = ''139 140 141 142 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 143 143 ;------------------------------------------------------------ 144 144 ; case on the caes where the caption is applied 145 145 ;------------------------------------------------------------ 146 147 148 149 150 151 152 153 154 155 156 157 158 159 IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny, 1)160 161 162 163 !p.title = zonalf+varexp+datef+svardate+fieldf+varname164 165 166 167 168 169 170 171 172 IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx, 1)173 174 175 176 !p.title = meridf+varexp+datef+svardate+fieldf+varname177 178 179 180 181 182 183 184 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 185 185 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) 186 187 188 !p.title = hovxt+varexp+fieldf+varname189 190 191 192 193 194 195 196 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 197 197 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) 198 199 200 !p.title = hovyt+varexp+fieldf+varname201 202 203 204 205 206 207 208 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 209 209 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1) 210 211 212 213 214 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 215 215 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE BEGIN 216 216 ; if keyword_set(integration3d) then n=strtrim(nx*ny*nz, 1) ELSE n=strtrim(nx*ny, 1) 217 217 ; ENDELSE 218 219 220 221 222 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 223 223 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny*nz, 1) 224 225 226 !p.title = varexp+datef+svardate+fieldf+varname227 228 229 230 231 232 233 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 234 234 ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*nz, 1) 235 236 237 !p.title = varexp+datef+svardate+fieldf+varname238 239 240 241 242 243 244 245 IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1)246 247 248 249 250 251 IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny*nz, 1)252 253 254 255 256 257 258 259 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 $ 260 260 !p.subtitle = lonintf+'['+lo1+', '+lo2+']'+onf+'('+strtrim(nx, 1)+' points) !C' +!p.subtitle 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 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 276 276 end -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro
r150 r152 64 64 ELSE type = widget_info(actionid, /combobox_gettext) 65 65 case type of 66 'plt':procedure = 'plt'67 'pltz':procedure = 'pltz'68 66 'pltz diag up':procedure = 'pltz' 69 67 'pltz diag dn':procedure = 'pltz' 70 'pltt':procedure = 'pltt'71 68 'pltt diag up':procedure = 'pltt' 72 69 'pltt diag dn':procedure = 'pltt' … … 81 78 'z':procedure = 'plt1d' 82 79 't':procedure = 'pltt' 80 ELSE:procedure = type 83 81 endcase 84 82 ; -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro
r150 r152 57 57 !y = (extractatt(top_uvalue, 'yenvs'))[numdessin] 58 58 ;------------------------------------------------------------ 59 actionid = widget_info(event.top, find_by_uname = 'action') 60 type = widget_info(actionid, /combobox_gettext) 61 ;------------------------------------------------------------ 59 62 ; Change the domain box: 60 63 ;------------------------------------------------------------ … … 63 66 y = [coor[1, 0], coor[1, 1]] 64 67 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] 66 79 ; Do we have to pass the boxzoom in indexes ??? 67 80 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 … … 88 101 widget_control, domainid, set_value = boxzoom 89 102 ; 90 ;------------------------------------------------------------91 actionid = widget_info(event.top, find_by_uname = 'action')92 type = widget_info(actionid, /combobox_gettext)93 103 case uval.press of 94 104 1:BEGIN -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.pro
r150 r152 25 25 'datafilename':BEGIN 26 26 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) 28 29 if size(filename, /type) NE 7 then BEGIN 29 30 widget_control, event.id, set_value = '' … … 33 34 END 34 35 '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) 36 37 if size(filename, /type) NE 7 then return 37 38 widget_control, widget_info(event.handler, find_by_uname = 'datafilename') $ … … 102 103 datafilename = datafilename[0] 103 104 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) 105 107 if size(datafilename, /type) NE 7 then BEGIN 106 108 widget_control, widget_info(event.handler, find_by_uname = 'datafilename') $ … … 266 268 , izmindta:izmindta, izmaxdta:izmaxdta} 267 269 268 res3 = scanfile(res.datafilename, iodir = iodir,_extra = ex)270 res3 = scanfile(res.datafilename, _extra = ex) 269 271 if size(res3, /type) NE 8 then return, -1 270 272 -
trunk/SRC/ToBeReviewed/WIDGET/xxx.pro
r150 r152 229 229 xoff = 0 230 230 yoff = 0 231 pltlst = ['plt' $231 pltlst = ['plt', 'pltv' $ 232 232 , 'pltz', 'pltz diag up', 'pltz diag dn' $ 233 233 , 'pltt', 'pltt diag up', 'pltt diag dn' $ -
trunk/SRC/Utilities/find.pro
r136 r152 24 24 ; activate this keyword to stop looking for the file as soon as we found one. 25 25 ; 26 ; @keyword IODIRECTORY {default= !path}26 ; @keyword IODIRECTORY {default=['.',!path]} 27 27 ; A scalar or array variable of string type, containing 28 28 ; directories names where we are looking for the file. … … 34 34 ; 35 35 ; @keyword LOOKALLDIR 36 ; activate to look for the file with a recursive search37 ; 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. 38 38 ; 39 39 ; @keyword NOPRO … … 56 56 ; @keyword UNIQUE 57 57 ; 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) 58 64 ; 59 65 ; @keyword _EXTRA … … 106 112 , REPERTOIRE = repertoire, NOPRO = nopro, ONLYPRO = onlypro $ 107 113 , ONLYNC = onlync, UNIQUE = unique, FIRSTFOUND = firstfound $ 108 , LOOKALLDIR = LOOKALLDIR, _extra = ex114 , LOOKALLDIR = LOOKALLDIR, TRYFIND = tryfind, _extra = ex 109 115 ; define where we look for the file 110 116 ; … … 114 120 keyword_set(lookalldir):BEGIN 115 121 @cm_general 116 dirnames = [ iodir, homedir, !path]122 dirnames = ['./', iodir, homedir, !path] 117 123 tstdtadir= file_dirname(find('find', /onlypro), /mark_directory) 118 124 tstdtadir = (file_search(tstdtadir+'../../DATA/TestsData'))[0] … … 121 127 keyword_set(iodirectory): dirnames = iodirectory 122 128 keyword_set(repertoire): dirnames = repertoire 123 ELSE: dirnames = !path129 ELSE: dirnames = ['./', !path] 124 130 ENDCASE 125 131 tmp = dirnames … … 164 170 ENDIF 165 171 ENDFOR 172 166 173 IF n_elements(fileout) EQ 1 THEN fileout = 'NOT FOUND' $ 167 174 ELSE fileout = fileout[1:*] … … 171 178 ENDIF ELSE fileout = fileout[0] 172 179 ; 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 ; 173 190 RETURN, fileout 174 191 END
Note: See TracChangeset
for help on using the changeset viewer.