Changeset 388
- Timestamp:
- 12/09/08 10:36:41 (15 years ago)
- Location:
- trunk/SRC
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/restoreboxparam.pro
r371 r388 73 73 nzt = boxzoomparam.indexes[28] 74 74 nzw = boxzoomparam.indexes[29] 75 key_irregular = boxzoomparam.key 75 key_shift = boxzoomparam.key[0] 76 key_periodic = boxzoomparam.key[1] 77 key_stride = boxzoomparam.key[2] 78 key_gridtype = boxzoomparam.key[3] 79 key_yreverse = boxzoomparam.key[4] 80 key_zreverse = boxzoomparam.key[5] 81 key_partialstep = boxzoomparam.key[6] 82 key_onearth = boxzoomparam.key[7] 76 83 ; 77 84 boxzoomparam = -1 -
trunk/SRC/Grid/saveboxparam.pro
r371 r388 42 42 boxzoomparam = {bound:[lon1, lon2, lat1, lat2, vert1, vert2] $ 43 43 , indexes:[firstxt, lastxt, firstyt, lastyt $ 44 , firstxu, lastxu, firstyu, lastyu $ 45 , firstxv, lastxv, firstyv, lastyv $ 46 , firstxf, lastxf, firstyf, lastyf $ 47 , firstzt, lastzt, firstzw, lastzw $ 48 , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw] $ 49 , key:key_irregular} 44 , firstxu, lastxu, firstyu, lastyu $ 45 , firstxv, lastxv, firstyv, lastyv $ 46 , firstxf, lastxf, firstyf, lastyf $ 47 , firstzt, lastzt, firstzw, lastzw $ 48 , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw] $ 49 , key:[key_shift, key_periodic, key_stride, key_gridtype $ 50 , key_yreverse, key_zreverse, key_partialstep, key_onearth]} 50 51 ; 51 52 ENDIF ELSE BEGIN … … 58 59 , firstzt, lastzt, firstzw, lastzw $ 59 60 , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw $ 60 , key_irregular, filename = myuniquetmpdir + filename 61 , key_shift, key_periodic, key_stride, key_gridtype $ 62 , key_yreverse, key_zreverse, key_partialstep, key_onearth $ 63 , filename = myuniquetmpdir + filename 61 64 ; 62 65 ENDELSE -
trunk/SRC/ToBeReviewed/GRILLE/decoupeterre.pro
r386 r388 34 34 ; @keyword USETRI 35 35 ; 36 ; @keyword MASKDTA 37 ; 2d array defining the mask that must be applied to the data instead 38 ; of the default mask which is defined according to the grid (t/u/v/f mask) 39 ; 36 40 ; @keyword _EXTRA 37 41 ; Used to pass keywords … … 64 68 PRO decoupeterre, mask, glam, gphi, gdep $ 65 69 , TYPE=type, TRI=tri, INDICEZOOM=indicezoom $ 66 , COINMONTE=coinmonte, COINDESCEND=coindescend $70 , COINMONTE=coinmonte, COINDESCEND=coindescend, MASKDTA = maskdta $ 67 71 , WDEPTH=wdepth, REALSECTION=realsection, USETRI=usetri $ 68 72 , _EXTRA=ex … … 193 197 ;------------------------------------------------------------ 194 198 if keyword_set(wdepth) then begin 195 firstz = 0 > (min([firstzt, firstzw])-1) 196 lastz = (max([lastzt, lastzw])+1) < (jpk-1) 199 firstzw = 0 > (min([firstzt, firstzw])-1) 200 lastzw = (max([lastzt, lastzw])+1) < (jpk-1) 201 nzw = lastzw - firstzw + 1 202 firstz = firstzw 203 lastz = lastzw 204 nz = nzw 197 205 ENDIF ELSE BEGIN 198 206 firstz = firstzt 199 207 lastz = lastzt 208 nz = nzt 200 209 ENDELSE 201 nz = lastz-firstz+1202 210 ;------------------------------------------------------------ 203 211 ; mask 204 212 ;------------------------------------------------------------ 213 IF keyword_set(maskdta) THEN BEGIN 214 mask = byte(fitintobox(maskdta)) 215 IF keyword_set(wdepth) THEN BEGIN 216 mask = shift(temporary(mask), 0, 1) 217 mask[*, 0] = 0b 218 ENDIF 219 ENDIF ELSE BEGIN 205 220 case type of 206 221 'xy':BEGIN … … 221 236 END 222 237 ELSE:mask = tmask[firstx:lastx, firsty:lasty, firstz:lastz] 223 endcase 238 ENDCASE 239 ENDELSE 224 240 ;------------------------------------------------------------ 225 241 ; vertical axis … … 240 256 ; in that case, the z axis is a 2d array and we modify the depth of 241 257 ; the last level ocean with hdepw that is the real depth of the bottom. 258 ; in domzgr: hdepw(ji,jj) = gdepw(ji,jj,ik+1) 242 259 CASE 1 OF 243 keyword_set(key_partialstep) andtype EQ 'xz' $260 keyword_set(key_partialstep) AND type EQ 'xz' $ 244 261 AND ny EQ 1 AND keyword_set(realsection):BEGIN 245 bottom = total(mask, 3 )262 bottom = total(mask, 3 - keyword_set(maskdta)) 246 263 good = where(bottom NE 0 AND bottom NE nz) 247 bottom = lindgen(nx)+(bottom)*nx248 264 IF good[0] NE -1 THEN BEGIN 265 bottom = lindgen(nx)+(bottom)*nx 249 266 bottom = bottom[good] 250 267 gdep = replicate(1, nx)#gdep … … 253 270 ENDIF 254 271 END 255 keyword_set(key_partialstep) andtype EQ 'yz' $272 keyword_set(key_partialstep) AND type EQ 'yz' $ 256 273 AND nx EQ 1 AND keyword_set(realsection):BEGIN 257 bottom = total(mask, 3 )274 bottom = total(mask, 3 - keyword_set(maskdta)) 258 275 good = where(bottom NE 0 AND bottom NE nz) 259 bottom = lindgen(ny)+(bottom)*ny260 276 IF good[0] NE -1 THEN BEGIN 277 bottom = lindgen(ny)+(bottom)*ny 261 278 bottom = bottom[good] 262 279 gdep = replicate(1, ny)#gdep -
trunk/SRC/ToBeReviewed/GRILLE/grille.pro
r378 r388 21 21 ; This keyword is used in <pro>plt</pro>. 22 22 ; 23 ; @keyword WDEPTH 23 ; @keyword GRID {default=vargrid defined in <pro>cm_4data</pro>} 24 ; To specify on which grid are located the data 25 ; 26 ; @keyword WDEPTH {default=0} 24 27 ; To specify that the field is at W depth instead of T 25 28 ; depth (automatically activated if vargrid eq 'W') … … 114 117 , e1, e2, e3 $ 115 118 , TRI=tri, NOTRI=notri, TOUT=tout, FORPLT=forplt $ 116 , TYPE=type, WDEPTH=wdepth, _EXTRA=ex119 , TYPE=type, WDEPTH=wdepth, GRID = grid, _EXTRA=ex 117 120 ; 118 121 compile_opt idl2, strictarrsubs … … 129 132 vargrid = strupcase(strmid(vargrid,0,/reverse_offset)) 130 133 ; 134 IF size(grid, /type) EQ 7 THEN vargrid = strupcase(grid) 131 135 if vargrid eq 'W' then wdepth = 1 132 136 if keyword_set(tout) then begin … … 356 360 ENDELSE 357 361 ; for the vertical sections with partial steps 362 ; from domzgh: hdept(ji,jj) = gdept(ji,jj,ik ) 363 ; hdepw(ji, jj) = gdepw(ji, jj, ik+1) 358 364 IF keyword_set(type) AND keyword_set(key_partialstep) THEN BEGIN 359 365 CASE 1 OF 360 366 type EQ 'xz' AND ny EQ 1:BEGIN 361 367 bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 362 good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) 363 bottom = lindgen(nx)+(bottom-1l+keyword_set(wdepth))*nx 368 good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth)) 364 369 IF good[0] NE -1 THEN BEGIN 370 bottom = lindgen(nx)+(bottom-(1l+keyword_set(wdepth)))*nx 365 371 bottom = bottom[good] 366 372 IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw) … … 374 380 type EQ 'yz' AND nx EQ 1:BEGIN 375 381 bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 376 good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) 377 bottom = lindgen(ny)+(bottom-1l+keyword_set(wdepth))*ny 382 good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth)) 378 383 IF good[0] NE -1 THEN BEGIN 384 bottom = lindgen(ny)+(bottom-(1l+keyword_set(wdepth)))*ny 379 385 bottom = bottom[good] 380 386 IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw) -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
r378 r388 93 93 ; For these ones traced by a trait, use CONTLABEL. 94 94 ; 95 ; @keyword MASKFILL 96 ; set to 0 to avoid to fill the masked values 97 ; 95 98 ; @keyword MAXIN 96 99 ; to specify the max value we want to plot with a keyword instead of with the … … 109 112 ; @keyword NOFILL 110 113 ; To make just isolines with no filling 114 ; 115 ; @keyword NOMASK 116 ; activate to supress the use of the land-sea mask when plotting the field 117 ; 118 ; @keyword NO_PARTIALSTEP 119 ; activate to supress the use of partial steps (force key_partialstep = 0 within pltz) 111 120 ; 112 121 ; @keyword NOTRI … … 116 125 ; the keyword CELL_FILL=2. 117 126 ; Comment: if the field contain points !values.f_nan, then we even do a triangulation. 127 ; 128 ; @keyword MASKDTA 129 ; 2d array defining the mask that must be applied to the data instead 130 ; of the default mask which is defined according to the grid (t/u/v/f mask) 118 131 ; 119 132 ; @keyword OVERPLOT … … 172 185 , STYLE=style, CONTMAX=contmax, SIN=sin, TYPEIN=typein $ 173 186 , CONTMIN=contmin, NLEVEL=nlevel, CONTNLEVEL=contnlevel $ 174 , NOFILL=nofill, NOTRI=notri, USETRI=usetri, FILLXDIR=fillxdir $ 187 , NOFILL=nofill, NOMASK = nomask, NO_PARTIALSTEP = no_partialstep, NOTRI=notri $ 188 , USETRI = usetri, FILLXDIR = fillxdir $ 175 189 , ZOOM=zoom, XZ=xz, YZ=yz, MININ=minin, MAXIN=maxin $ 176 , STRICTFILL=strictfill, OVERPLOT=overplot , MASKFILL=maskfill$177 , WDEPTH=wdepth, REALSECTION=realsection $190 , STRICTFILL=strictfill, OVERPLOT=overplot $ 191 , WDEPTH=wdepth, REALSECTION=realsection, MASKFILL=maskfill, MASKDTA = maskdta $ 178 192 , _EXTRA=ex 179 193 ; … … 197 211 ; 198 212 if n_elements(contour) ne 4 THEN saveboxparam, 'boxparam4pltz.dat' 213 key_partialstep = keyword_set(key_partialstep) * (1b - keyword_set(no_partialstep)) 199 214 ;-------------------------------------------------------------- 200 215 ; Reading of the field. … … 262 277 ; to draw from bottom to top (avoid using cell_fill) 263 278 z2d = reverse(z2d, 2) 279 szmsk = size(mask, /dimensions) 280 IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1]) 281 IF keyword_set(maskdta) THEN mask = byte(fitintobox(maskdta)) 264 282 ;----------------------------------------------------------------------------- 265 283 ; Determination of the mi:min and of the ma:max of z2d in the same way … … 355 373 if keyword_set(nan) then trinan = triangule(masknan, /basic, coinmonte = coinmontenan, coindescend = coindescendnan) 356 374 maskorg = mask 357 decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection 375 decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection, MASKDTA = maskdta 358 376 axis4pltz, type, mask, glammsk, gphimsk, gdepmsk, XXAXIS = xmask, ZZAXIS = zmask, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex 377 szmsk = size(mask, /dimensions) 378 IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1]) 359 379 ENDIF ELSE BEGIN 360 380 xmask = xxaxis -
trunk/SRC/Utilities/fitintobox.pro
r375 r388 89 89 ; @param lastz {in}{optional}{default=define by <pro>grille</pro>} 90 90 ; 91 ; @keyword WDEPTH 92 ; To specify that we are at W level 91 ; @keyword GRID {default=vargrid defined in <pro>cm_4data</pro>} 92 ; To specify on which grid are located the data, see <pro>grille</pro> 93 ; 94 ; @keyword WDEPTH {default=0} 95 ; To specify that we are at W level, see <pro>grille</pro> 93 96 ; 94 97 ; @returns … … 120 123 ;- 121 124 FUNCTION fitintobox, field, nx, ny, nz, firstx, firsty $ 122 , firstz, lastx, lasty, lastz, WDEPTH=wdepth125 , firstz, lastx, lasty, lastz, GRID = GRID, WDEPTH = wdepth 123 126 ; 124 127 compile_opt idl2, strictarrsubs … … 132 135 arr = litchamp(field) 133 136 IF n_params() EQ 1 THEN grille, -1, -1, -1, -1, nx, ny, nz $ 134 , firstx, firsty, firstz, lastx, lasty, lastz, WDEPTH = wdepth137 , firstx, firsty, firstz, lastx, lasty, lastz, GRID = GRID, WDEPTH = wdepth 135 138 ;-------------------------------------------------------------- 136 139 ;--------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.