Changeset 231 for trunk/SRC/ToBeReviewed/PLOTS/DIVERS/checkfield.pro
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DIVERS/checkfield.pro
r163 r231 1 1 ;+ 2 ; @file_comments3 ; 4 ; 2 ; 3 ; @file_comments 4 ; 5 5 ; @categories 6 ; 7 ; 6 ; 8 7 ; @param TYPE {in}{required}{type=string} 9 8 ; A string of two characters specifying the type of plot we do … … 21 20 ; 22 21 ; @returns 23 ; 24 ; 22 ; 25 23 ; @restrictions 26 ; 27 ; 24 ; 28 25 ; @examples 29 26 ; 30 ;31 27 ; @history 32 ;33 28 ; 34 29 ; @version 35 30 ; $Id$ 36 31 ;- 32 ; 37 33 FUNCTION err_1d, type, n1, name, n2 38 34 ; … … 45 41 ; 46 42 ;+ 47 ; @file_comments48 ; 49 ; 43 ; 44 ; @file_comments 45 ; 50 46 ; @categories 51 ; 52 ; 47 ; 53 48 ; @param TYPE {in}{required}{type=string} 54 49 ; A string of two characters specifying the type of plot we do 55 50 ; 56 ; @param SZ {in}{optional}{default=defined by grille.pro}57 ; 58 ; @param NX {in}{optional}{default=defined by grille.pro}59 ; 60 ; @param NY {in}{optional}{default=defined by grille.pro}61 ; 51 ; @param SZ {in}{optional}{default=defined by <pro>grille<pro>} 52 ; 53 ; @param NX {in}{optional}{default=defined by <pro>grille</pro>} 54 ; 55 ; @param NY {in}{optional}{default=defined by <pro>grille</pro>} 56 ; 62 57 ; @param NZ 63 ; 64 ; 58 ; 65 59 ; @returns 66 ; 67 ; 60 ; 68 61 ; @restrictions 69 ; 70 ; 62 ; 71 63 ; @examples 72 64 ; 73 ;74 65 ; @history 75 ;76 66 ; 77 67 ; @version 78 68 ; $Id$ 79 69 ;- 70 ; 80 71 FUNCTION err_2d, type, sz, nx, ny, nz 81 72 ; … … 95 86 ; 96 87 ;+ 97 ; @file_comments98 ; 99 ; 88 ; 89 ; @file_comments 90 ; 100 91 ; @categories 101 ; 102 ; 92 ; 103 93 ; @param TYPE {in}{required}{type=string} 104 94 ; A string of two characters specifying the type of plot we do 105 95 ; 106 ; @param SZ {in}{optional}{default=defined by grille.pro}107 ; 108 ; @param NX {in}{optional}{default=defined by grille.pro}109 ; 110 ; @param NY {in}{optional}{default=defined by grille.pro}111 ; 96 ; @param SZ {in}{optional}{default=defined by <pro>grille</pro>} 97 ; 98 ; @param NX {in}{optional}{default=defined by <pro>grille</pro>} 99 ; 100 ; @param NY {in}{optional}{default=defined by <pro>grille</pro>} 101 ; 112 102 ; @param NZ 113 ; 114 ; 103 ; 115 104 ; @returns 116 ; 117 ; 105 ; 118 106 ; @restrictions 119 ; 120 ; 107 ; 121 108 ; @examples 122 109 ; 123 ;124 110 ; @history 125 ;126 111 ; 127 112 ; @version 128 113 ; $Id$ 114 ; 129 115 ;- 116 ; 130 117 FUNCTION err_3d, type, sz, nx, ny, nz 131 118 ; … … 143 130 + ', ' + strtrim(jpt, 1) + ']'], /simple) 144 131 END 145 ;------------------------------------------------------------ 146 ;------------------------------------------------------------ 147 ;------------------------------------------------------------ 132 ; 148 133 ;+ 149 134 ; 150 135 ; @file_comments 151 ; In input of plt, pltz, pltt and plt1d, it check that the field give 152 ; a size compatible with the domain and, if needed, average to give us 136 ; In input of plt, pltz, pltt and plt1d, it check that the field give 137 ; a size compatible with the domain and, if needed, average to give us 153 138 ; a 2d array if we make a plot of the type: 'xy', 'xz', 'xt', 'yz', 'yt' 154 139 ; , 'zt' or a 1d array if we make a plot of the type: 'x', 'y', 'z', 't'. … … 156 141 ; @categories 157 142 ; Graphics 158 ; 143 ; 159 144 ; @param FIELD {in}{required}{type=field} 160 ; It respect litchamp.pro's criterions. See IDL>xhelp,'litchamp'145 ; It respect <pro>litchamp</pro>'s criterions. See IDL>xhelp,'litchamp' 161 146 ; 162 147 ; @param PROCEDURE {in}{required} 163 148 ; 164 ;165 149 ; @keyword TYPE 166 150 ; 167 ;168 151 ; @keyword NOQUESTION 169 152 ; 170 ;171 153 ; @keyword BOXZOOM {type=vector} 172 ; Vector indicating the geographic zone on which we want to cut the map. 154 ; Vector indicating the geographic zone on which we want to cut the map. 173 155 ; If BOXZOOM has : 174 156 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] … … 181 163 ; 182 164 ; @keyword WDEPTH 183 ; to specify that the field is at W depth instead of T 165 ; to specify that the field is at W depth instead of T 184 166 ; depth (automatically activated if vargrid eq 'W') 185 ; 167 ; 186 168 ; @keyword VECTEUR{type=vetcor} 187 169 ; It is a structure composed by 2 elements containing the 2 fields U … … 193 175 ; 194 176 ; @keyword _EXTRA 195 ; used to pass your keywords 196 ; 197 ; @keyword DIREC 198 ; 199 ; 200 ; @uses 177 ; Used to pass keywords 178 ; 179 ; @keyword DIREC 180 ; 181 ; @uses 201 182 ; common.pro 202 183 ; … … 208 189 ; $Id$ 209 190 ; 210 ; @todo seb: mettre les param 191 ; @todo seb: mettre les param 211 192 ; 212 193 ;- 213 ;------------------------------------------------------------214 ;------------------------------------------------------------215 ;--------------------------------------------------------------216 194 ; 217 195 FUNCTION checkfield, field, procedure, TYPE = type, BOXZOOM = boxzoom, DIREC = direc, NOQUESTION = noquestion, VECTEUR = vecteur, WDEPTH = wdepth, _EXTRA = ex 218 ;--------------------------------------------------------------219 196 ; 220 197 compile_opt idl2, strictarrsubs 221 198 ; 222 ; include commons223 199 @cm_4mesh 224 200 @cm_4cal … … 237 213 if arr EQ -1 then $ 238 214 return, report('Error: input array = -1. Maybe the reading did ont perform well...', /simple) $ 239 ELSE return, report('Error: input array is a scalar', /simple) 215 ELSE return, report('Error: input array is a scalar', /simple) 240 216 ENDIF 241 217 nan = total(finite(arr, /nan)) < 1 … … 264 240 ENDIF 265 241 ; 266 ; The procedure domdef determine elements which are inside the boxzoom. 267 ; 242 ; The procedure domdef determine elements which are inside the boxzoom. 243 ; 268 244 if strpos(type, 'z') NE -1 THEN BEGIN 269 if NOT keyword_set(localbox) then BEGIN 245 if NOT keyword_set(localbox) then BEGIN 270 246 localbox = [minprof, profdefault] 271 247 if keyword_set(wdepth) then grillechoice = 'W' $ … … 275 251 nelbox = n_elements(localbox) 276 252 ;we keep yranges (z axis) before changing the boxzoom. 277 !y.range = [localbox[nelbox-1], localbox[nelbox-2]] 253 !y.range = [localbox[nelbox-1], localbox[nelbox-2]] 278 254 if vargrid EQ 'W' OR keyword_set(wdepth) then BEGIN 279 255 firstzw = 0 > (firstzw-1) … … 329 305 , 'Impossible to make a "'+type+'" plot with a 1D array'], /simple) 330 306 ENDCASE 331 END 307 END 332 308 ;-------------------------------------------------------------- 333 309 2:BEGIN … … 372 348 'zt':IF sz[1] NE nz OR sz[2] NE jpt THEN return, err_2d(type, sz, nx, ny, nz) ; zt array 373 349 ENDCASE 374 END 350 END 375 351 ;-------------------------------------------------------------- 376 352 3:BEGIN … … 426 402 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'x' ; xyz array 427 403 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 't' ; (x)yzt 428 ELSE:return, err_3d(type, sz, nx, ny, nz) 404 ELSE:return, err_3d(type, sz, nx, ny, nz) 429 405 endcase 430 406 END … … 433 409 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'y' ; xyt array 434 410 sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'z' ; x(y)zt array 435 ELSE:return, err_3d(type, sz, nx, ny, nz) 411 ELSE:return, err_3d(type, sz, nx, ny, nz) 436 412 endcase 437 413 END … … 440 416 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'x' ; xyt array 441 417 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'z' ; (x)yzt array 442 ELSE:return, err_3d(type, sz, nx, ny, nz) 418 ELSE:return, err_3d(type, sz, nx, ny, nz) 443 419 endcase 444 420 END … … 447 423 sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'x' ; x(y)zt array 448 424 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'y' ; (x)yzt array 449 ELSE:return, err_3d(type, sz, nx, ny, nz) 425 ELSE:return, err_3d(type, sz, nx, ny, nz) 450 426 ENDCASE 451 END 452 ENDCASE 453 END 454 ;-------------------------------------------------------------- 455 4:BEGIN 427 END 428 ENDCASE 429 END 430 ;-------------------------------------------------------------- 431 4:BEGIN 456 432 CASE type OF 457 433 'x':direc = 'yzt' … … 465 441 'yt':direc = 'xz' 466 442 'zt':direc = 'xy' 467 ENDCASE 443 ENDCASE 468 444 END 469 445 ENDCASE
Note: See TracChangeset
for help on using the changeset viewer.