[157] | 1 | ;+ |
---|
[231] | 2 | ; |
---|
| 3 | ; @file_comments |
---|
| 4 | ; |
---|
[157] | 5 | ; @categories |
---|
[231] | 6 | ; |
---|
[163] | 7 | ; @param TYPE {in}{required}{type=string} |
---|
[157] | 8 | ; A string of two characters specifying the type of plot we do |
---|
| 9 | ; |
---|
[163] | 10 | ; @param N1 {in}{required}{type=integer} |
---|
[157] | 11 | ; Number of elements in the first dimension |
---|
| 12 | ; |
---|
[163] | 13 | ; @param N2 {in}{required}{type=integer} |
---|
[157] | 14 | ; Number of elements in the second dimension |
---|
| 15 | ; |
---|
[163] | 16 | ; @param NAME {in}{optional}{type=string} |
---|
[378] | 17 | ; It gives the name of the file to be opened. |
---|
| 18 | ; |
---|
| 19 | ; If NAME |
---|
[157] | 20 | ; does not contain the separating character of directories ('/' under |
---|
| 21 | ; unix for example), the file will be looked for in the current directory. |
---|
| 22 | ; |
---|
| 23 | ; @returns |
---|
[231] | 24 | ; |
---|
[157] | 25 | ; @restrictions |
---|
[231] | 26 | ; |
---|
[157] | 27 | ; @examples |
---|
| 28 | ; |
---|
| 29 | ; @history |
---|
| 30 | ; |
---|
| 31 | ; @version |
---|
| 32 | ; $Id$ |
---|
[237] | 33 | ; |
---|
[157] | 34 | ;- |
---|
[37] | 35 | FUNCTION err_1d, type, n1, name, n2 |
---|
[114] | 36 | ; |
---|
| 37 | compile_opt idl2, strictarrsubs |
---|
| 38 | ; |
---|
[37] | 39 | return, report(['Error in "' + type + '" type plot with a 1D input array:' $ |
---|
| 40 | , 'the number of elements of the input vector ('+strtrim(n1, 1)+') ' $ |
---|
| 41 | , 'is not equal to ' + name + ' ('+strtrim(n2, 1)+')'], /simple) |
---|
| 42 | END |
---|
| 43 | ; |
---|
[157] | 44 | ;+ |
---|
[231] | 45 | ; |
---|
| 46 | ; @file_comments |
---|
| 47 | ; |
---|
[157] | 48 | ; @categories |
---|
[231] | 49 | ; |
---|
[163] | 50 | ; @param TYPE {in}{required}{type=string} |
---|
[157] | 51 | ; A string of two characters specifying the type of plot we do |
---|
| 52 | ; |
---|
[232] | 53 | ; @param SZ {in}{optional}{default=defined by <pro>grille</pro>} |
---|
[231] | 54 | ; |
---|
| 55 | ; @param NX {in}{optional}{default=defined by <pro>grille</pro>} |
---|
| 56 | ; |
---|
| 57 | ; @param NY {in}{optional}{default=defined by <pro>grille</pro>} |
---|
| 58 | ; |
---|
[157] | 59 | ; @param NZ |
---|
[231] | 60 | ; |
---|
[157] | 61 | ; @returns |
---|
[231] | 62 | ; |
---|
[157] | 63 | ; @restrictions |
---|
[231] | 64 | ; |
---|
[157] | 65 | ; @examples |
---|
| 66 | ; |
---|
| 67 | ; @history |
---|
| 68 | ; |
---|
| 69 | ; @version |
---|
| 70 | ; $Id$ |
---|
[237] | 71 | ; |
---|
[157] | 72 | ;- |
---|
[37] | 73 | FUNCTION err_2d, type, sz, nx, ny, nz |
---|
[114] | 74 | ; |
---|
| 75 | compile_opt idl2, strictarrsubs |
---|
| 76 | ; |
---|
[37] | 77 | @cm_4mesh |
---|
| 78 | @cm_4cal |
---|
| 79 | return, report(['Error in "' + type + '" type plot with a 2D input array:' $ |
---|
| 80 | , 'the array dimensions ' + tostr(sz[1:2]) + ' are incompatible' $ |
---|
[238] | 81 | , 'with the domain dimensions ' $ |
---|
[37] | 82 | , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ |
---|
| 83 | + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ |
---|
| 84 | + ', ' + strtrim(jpj, 1) + '/' + strtrim(ny, 1) $ |
---|
| 85 | + ', ' + strtrim(jpk, 1) + '/' + strtrim(nz, 1) $ |
---|
| 86 | + ', ' + strtrim(jpt, 1) + ']'], /simple) |
---|
| 87 | END |
---|
| 88 | ; |
---|
[157] | 89 | ;+ |
---|
[231] | 90 | ; |
---|
| 91 | ; @file_comments |
---|
| 92 | ; |
---|
[157] | 93 | ; @categories |
---|
[231] | 94 | ; |
---|
[163] | 95 | ; @param TYPE {in}{required}{type=string} |
---|
[157] | 96 | ; A string of two characters specifying the type of plot we do |
---|
| 97 | ; |
---|
[231] | 98 | ; @param SZ {in}{optional}{default=defined by <pro>grille</pro>} |
---|
| 99 | ; |
---|
| 100 | ; @param NX {in}{optional}{default=defined by <pro>grille</pro>} |
---|
| 101 | ; |
---|
| 102 | ; @param NY {in}{optional}{default=defined by <pro>grille</pro>} |
---|
| 103 | ; |
---|
[157] | 104 | ; @param NZ |
---|
[231] | 105 | ; |
---|
[157] | 106 | ; @returns |
---|
[231] | 107 | ; |
---|
[157] | 108 | ; @restrictions |
---|
[231] | 109 | ; |
---|
[157] | 110 | ; @examples |
---|
| 111 | ; |
---|
| 112 | ; @history |
---|
| 113 | ; |
---|
| 114 | ; @version |
---|
| 115 | ; $Id$ |
---|
[231] | 116 | ; |
---|
[157] | 117 | ;- |
---|
[37] | 118 | FUNCTION err_3d, type, sz, nx, ny, nz |
---|
[114] | 119 | ; |
---|
| 120 | compile_opt idl2, strictarrsubs |
---|
| 121 | ; |
---|
[37] | 122 | @cm_4mesh |
---|
| 123 | @cm_4cal |
---|
| 124 | return, report(['Error in "' + type + '" type plot with a 3D input array:' $ |
---|
| 125 | , 'the array dimensions ' + tostr(sz[1:3]) + ' are incompatible' $ |
---|
[238] | 126 | , 'with the domain dimensions ' $ |
---|
[37] | 127 | , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ |
---|
| 128 | + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ |
---|
| 129 | + ', ' + strtrim(jpj, 1) + '/' + strtrim(ny, 1) $ |
---|
| 130 | + ', ' + strtrim(jpk, 1) + '/' + strtrim(nz, 1) $ |
---|
| 131 | + ', ' + strtrim(jpt, 1) + ']'], /simple) |
---|
| 132 | END |
---|
[231] | 133 | ; |
---|
[142] | 134 | ;+ |
---|
| 135 | ; |
---|
| 136 | ; @file_comments |
---|
[296] | 137 | ; In input of <pro>plt</pro>, <pro>pltz</pro>, <pro>pltt</pro> and <pro>plt1d</pro>, it check that the field give |
---|
[231] | 138 | ; a size compatible with the domain and, if needed, average to give us |
---|
[142] | 139 | ; a 2d array if we make a plot of the type: 'xy', 'xz', 'xt', 'yz', 'yt' |
---|
| 140 | ; , 'zt' or a 1d array if we make a plot of the type: 'x', 'y', 'z', 't'. |
---|
| 141 | ; |
---|
| 142 | ; @categories |
---|
[157] | 143 | ; Graphics |
---|
[231] | 144 | ; |
---|
[163] | 145 | ; @param FIELD {in}{required}{type=field} |
---|
[378] | 146 | ; It respect <pro>litchamp</pro>'s criterions. |
---|
[142] | 147 | ; |
---|
[157] | 148 | ; @param PROCEDURE {in}{required} |
---|
| 149 | ; |
---|
| 150 | ; @keyword TYPE |
---|
| 151 | ; |
---|
| 152 | ; @keyword NOQUESTION |
---|
| 153 | ; |
---|
[163] | 154 | ; @keyword BOXZOOM {type=vector} |
---|
[231] | 155 | ; Vector indicating the geographic zone on which we want to cut the map. |
---|
[378] | 156 | ; |
---|
[142] | 157 | ; If BOXZOOM has : |
---|
| 158 | ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] |
---|
| 159 | ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] |
---|
| 160 | ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] |
---|
| 161 | ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] |
---|
| 162 | ; 6 elements: The extraction is made on Boxzoom |
---|
| 163 | ; |
---|
[237] | 164 | ; Where lon1, lon2,lat1,lat2 are global variables defined at the last |
---|
| 165 | ; <pro>domdef</pro> ! |
---|
[142] | 166 | ; |
---|
| 167 | ; @keyword WDEPTH |
---|
[231] | 168 | ; to specify that the field is at W depth instead of T |
---|
[142] | 169 | ; depth (automatically activated if vargrid eq 'W') |
---|
[231] | 170 | ; |
---|
[237] | 171 | ; @keyword VECTEUR{type=vector} |
---|
[142] | 172 | ; It is a structure composed by 2 elements containing the 2 fields U |
---|
[378] | 173 | ; and V of values of the zonal and meridian component of the vector of |
---|
| 174 | ; the fields to draw. |
---|
[142] | 175 | ; |
---|
[378] | 176 | ; These fields can be an array or a structure. |
---|
| 177 | ; For example: vecteur={matriceu:lec('unsurface'),matricev:lec('vnsurface')} |
---|
| 178 | ; |
---|
| 179 | ; Comment: name of elements of vectors are inconsequential. |
---|
| 180 | ; vecteur={u:lec('unsurface'),v:lec('vnsurface')} is also appropriated. |
---|
| 181 | ; |
---|
[142] | 182 | ; @keyword _EXTRA |
---|
[231] | 183 | ; Used to pass keywords |
---|
[142] | 184 | ; |
---|
[231] | 185 | ; @keyword DIREC |
---|
[142] | 186 | ; |
---|
[231] | 187 | ; @uses |
---|
[370] | 188 | ; <pro>common</pro> |
---|
[142] | 189 | ; |
---|
| 190 | ; @history |
---|
[157] | 191 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[142] | 192 | ; 08/02/2000 |
---|
| 193 | ; |
---|
| 194 | ; @version |
---|
| 195 | ; $Id$ |
---|
| 196 | ; |
---|
[231] | 197 | ; @todo seb: mettre les param |
---|
[142] | 198 | ; |
---|
| 199 | ;- |
---|
[327] | 200 | FUNCTION checkfield, field, procedure $ |
---|
| 201 | , TYPE=type, BOXZOOM=boxzoom, DIREC=direc $ |
---|
| 202 | , NOQUESTION=noquestion, VECTEUR=vecteur, WDEPTH=wdepth $ |
---|
| 203 | , _EXTRA=ex |
---|
[114] | 204 | ; |
---|
| 205 | compile_opt idl2, strictarrsubs |
---|
| 206 | ; |
---|
[37] | 207 | @cm_4mesh |
---|
| 208 | @cm_4cal |
---|
| 209 | @cm_4data |
---|
| 210 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
| 211 | @updatenew |
---|
| 212 | @updatekwd |
---|
| 213 | ENDIF |
---|
| 214 | ;-------------------------------------------------------------- |
---|
[142] | 215 | ; I1) Reading of the field |
---|
[2] | 216 | ;-------------------------------------------------------------- |
---|
[37] | 217 | if n_elements(field) EQ 0 then return, report('field undefined') |
---|
| 218 | arr = litchamp(field) |
---|
[360] | 219 | if vargrid eq 'W' then wdepth = 1 |
---|
[37] | 220 | ; first check |
---|
| 221 | IF n_elements(arr) EQ 1 THEN BEGIN |
---|
| 222 | if arr EQ -1 then $ |
---|
[365] | 223 | return, report('Error: input array = -1. Maybe the reading did not perform well...', /simple) $ |
---|
[231] | 224 | ELSE return, report('Error: input array is a scalar', /simple) |
---|
[37] | 225 | ENDIF |
---|
| 226 | nan = total(finite(arr, /nan)) < 1 |
---|
[2] | 227 | ;--------------------------------------------------------------- |
---|
[142] | 228 | ; redefinition of the domain |
---|
[2] | 229 | ;--------------------------------------------------------------- |
---|
[37] | 230 | minprof = 0. |
---|
| 231 | profdefault = 200. |
---|
[2] | 232 | ; |
---|
[37] | 233 | Case n_elements(boxzoom) OF |
---|
| 234 | 0: |
---|
| 235 | 1:localbox = [minprof, boxzoom[0]] |
---|
| 236 | 2:localbox = boxzoom |
---|
| 237 | 4:if strpos(type, 'z') NE -1 THEN $ |
---|
| 238 | localbox = [boxzoom, minprof, profdefault] ELSE localbox = boxzoom |
---|
| 239 | 5:localbox = [Boxzoom[0:3], minprof, Boxzoom[4]] |
---|
| 240 | 6:localbox = boxzoom |
---|
| 241 | Else: return, report('Bad definition of boxzoom') |
---|
| 242 | ENDCASE |
---|
[2] | 243 | ; |
---|
[37] | 244 | if keyword_set(localbox) then BEGIN |
---|
| 245 | if keyword_set(vecteur) then grillechoice = [vargrid, 'T', 'U', 'V'] $ |
---|
| 246 | ELSE grillechoice = [vargrid, 'T'] |
---|
| 247 | if keyword_set(wdepth) then grillechoice = [grillechoice, 'W'] |
---|
| 248 | domdef, localbox, GRIDTYPE = grillechoice, _extra = ex |
---|
| 249 | ENDIF |
---|
| 250 | ; |
---|
[231] | 251 | ; The procedure domdef determine elements which are inside the boxzoom. |
---|
| 252 | ; |
---|
[37] | 253 | if strpos(type, 'z') NE -1 THEN BEGIN |
---|
[231] | 254 | if NOT keyword_set(localbox) then BEGIN |
---|
[37] | 255 | localbox = [minprof, profdefault] |
---|
| 256 | if keyword_set(wdepth) then grillechoice = 'W' $ |
---|
| 257 | ELSE grillechoice = vargrid |
---|
| 258 | domdef, localbox, GRIDTYPE = grillechoice |
---|
| 259 | END |
---|
| 260 | nelbox = n_elements(localbox) |
---|
[142] | 261 | ;we keep yranges (z axis) before changing the boxzoom. |
---|
[231] | 262 | !y.range = [localbox[nelbox-1], localbox[nelbox-2]] |
---|
[360] | 263 | if keyword_set(wdepth) then BEGIN |
---|
[37] | 264 | firstzw = 0 > (firstzw-1) |
---|
| 265 | lastzw = (lastzw+1) < (jpk-1) |
---|
| 266 | nzw = lastzw - firstzw + 1 |
---|
| 267 | ENDIF ELSE BEGIN |
---|
| 268 | firstzt = 0 > (firstzt-1) |
---|
| 269 | lastzt = (lastzt+1) < (jpk-1) |
---|
| 270 | nzt = lastzt - firstzt + 1 |
---|
| 271 | ENDELSE |
---|
| 272 | @updateold |
---|
| 273 | ENDIF |
---|
| 274 | ; make the automatic definition of type for pltz if type is not specified. |
---|
| 275 | IF type EQ 'z' AND procedure EQ 'pltz' THEN $ |
---|
| 276 | if (lon2-lon1) gt (lat2-lat1) then type = 'xz' else type = 'yz' |
---|
| 277 | ; make the automatic definition of type for pltt if type is not specified. |
---|
| 278 | IF type EQ 'unkownpltt' AND procedure EQ 'pltt' THEN $ |
---|
| 279 | if (lon2-lon1) gt (lat2-lat1) then type = 'xt' else type = 'yt' |
---|
[2] | 280 | ;-------------------------------------------------------------- |
---|
[142] | 281 | ; verification of the input array size and the value of the type |
---|
[2] | 282 | ;-------------------------------------------------------------- |
---|
[37] | 283 | grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty $ |
---|
| 284 | , firstz, lastx, lasty, lastz, WDEPTH = wdepth |
---|
[2] | 285 | ;-------------------------------------------------------------- |
---|
[37] | 286 | ; basic checks |
---|
[2] | 287 | ;-------------------------------------------------------------- |
---|
[37] | 288 | CASE 1 OF |
---|
| 289 | nx EQ 1: IF strpos(type, 'x') NE -1 THEN return, report('Error: impossible to make a "' + type + '" type plot with nx = 1 ', /simple) |
---|
| 290 | ny EQ 1: IF strpos(type, 'y') NE -1 THEN return, report('Error: impossible to make a "' + type + '" type plot with ny = 1 ', /simple) |
---|
| 291 | nz EQ 1: IF strpos(type, 'z') NE -1 THEN return, report('Error: impossible to make a "' + type + '" type plot with nz = 1 ', /simple) |
---|
| 292 | jpt EQ 1: IF strpos(type, 't') NE -1 THEN return, report('Error: impossible to make a "' + type + '" type plot with jpt = 1 ', /simple) |
---|
| 293 | ELSE: |
---|
| 294 | ENDCASE |
---|
[2] | 295 | ;-------------------------------------------------------------- |
---|
[297] | 296 | ; is the size of the array compatible with the domain? |
---|
[2] | 297 | ;-------------------------------------------------------------- |
---|
[37] | 298 | arr = fitintobox(temporary(arr), nx, ny, nz, firstx, firsty $ |
---|
| 299 | , firstz, lastx, lasty, lastz) |
---|
[2] | 300 | ;-------------------------------------------------------------- |
---|
[37] | 301 | sz = size(arr) |
---|
| 302 | case sz[0] of |
---|
[2] | 303 | ;-------------------------------------------------------------- |
---|
[37] | 304 | 0:return, arr |
---|
[2] | 305 | ;-------------------------------------------------------------- |
---|
[37] | 306 | 1:BEGIN |
---|
| 307 | nele = n_elements(arr) |
---|
| 308 | case type of |
---|
| 309 | 't':if jpt NE nele THEN return, err_1d(type, nele, 'jpt', jpt) |
---|
| 310 | 'x':IF nx NE nele THEN return, err_1d(type, nele, 'nx', nx) |
---|
| 311 | 'y':IF ny NE nele THEN return, err_1d(type, nele, 'ny', ny) |
---|
| 312 | 'z':IF nz NE nele THEN return, err_1d(type, nele, 'nz', nx) |
---|
[69] | 313 | ELSE:return, report(['Error: ' $ |
---|
| 314 | , 'Impossible to make a "'+type+'" plot with a 1D array'], /simple) |
---|
[37] | 315 | ENDCASE |
---|
[231] | 316 | END |
---|
[2] | 317 | ;-------------------------------------------------------------- |
---|
[37] | 318 | 2:BEGIN |
---|
| 319 | case type of |
---|
| 320 | 'x':BEGIN |
---|
| 321 | case 1 of |
---|
| 322 | sz[1] EQ nx AND sz[2] EQ ny:direc = 'y' ; xy array |
---|
| 323 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz:direc = 'z' ; x(y)z array |
---|
| 324 | sz[1] EQ nx AND sz[2] EQ jpt:direc = 't' ; xt array |
---|
| 325 | ELSE:return, err_2d(type, sz, nx, ny, nz) |
---|
| 326 | endcase |
---|
| 327 | end |
---|
| 328 | 'y':BEGIN |
---|
| 329 | case 1 of |
---|
| 330 | sz[1] EQ nx AND sz[2] EQ ny:direc = 'x' ; xy array |
---|
| 331 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz:direc = 'z' ; (x)yz array |
---|
| 332 | sz[1] EQ ny AND sz[2] EQ jpt:direc = 't' ; yt array |
---|
| 333 | ELSE:return, err_2d(type, sz, nx, ny, nz) |
---|
| 334 | endcase |
---|
| 335 | END |
---|
| 336 | 'z':BEGIN |
---|
| 337 | case 1 of |
---|
| 338 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz:direc = 'x' ; x(y)z array |
---|
| 339 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz:direc = 'y' ; (x)yz array |
---|
| 340 | sz[1] EQ nz AND sz[2] EQ jpt:direc = 't' ; zt array |
---|
| 341 | ELSE:return, err_2d(type, sz, nx, ny, nz) |
---|
| 342 | endcase |
---|
| 343 | END |
---|
| 344 | 't':BEGIN |
---|
| 345 | case 1 OF |
---|
| 346 | sz[1] EQ nx AND sz[2] EQ jpt:direc = 'x' ; xt array |
---|
| 347 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ jpt:direc = 'y' ; (x)yt array |
---|
| 348 | nx EQ 1 AND ny EQ 1 AND sz[1] EQ nz AND sz[2] EQ jpt:direc = 'z' ; (x)(y)zt array |
---|
| 349 | ELSE:return, err_2d(type, sz, nx, ny, nz) |
---|
| 350 | ENDCASE |
---|
| 351 | END |
---|
| 352 | 'xy':IF sz[1] NE nx OR sz[2] ne ny THEN return, err_2d(type, sz, nx, ny, nz) ; xy array |
---|
| 353 | 'xz':IF sz[1] NE nx OR sz[2] ne nz THEN return, err_2d(type, sz, nx, ny, nz) ; xz array |
---|
| 354 | 'yz':IF sz[1] NE ny OR sz[2] NE nz THEN return, err_2d(type, sz, nx, ny, nz) ; yz array |
---|
| 355 | 'xt':IF sz[1] NE nx OR sz[2] NE jpt THEN return, err_2d(type, sz, nx, ny, nz) ; xt array |
---|
| 356 | 'yt':IF sz[1] NE ny OR sz[2] NE jpt THEN return, err_2d(type, sz, nx, ny, nz) ; yt array |
---|
| 357 | 'zt':IF sz[1] NE nz OR sz[2] NE jpt THEN return, err_2d(type, sz, nx, ny, nz) ; zt array |
---|
| 358 | ENDCASE |
---|
[231] | 359 | END |
---|
[2] | 360 | ;-------------------------------------------------------------- |
---|
[37] | 361 | 3:BEGIN |
---|
| 362 | case type of |
---|
| 363 | 'x':BEGIN |
---|
| 364 | case 1 of |
---|
| 365 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'yz' ; xyz array |
---|
| 366 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'zt' ; x(y)zt array |
---|
| 367 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'yt' ; xyt array |
---|
| 368 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 369 | endcase |
---|
| 370 | END |
---|
| 371 | 'y':BEGIN |
---|
| 372 | case 1 of |
---|
| 373 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'xz' ; xyz array |
---|
| 374 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'zt' ; (x)yzt array |
---|
| 375 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'xt' ; xyt array |
---|
| 376 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 377 | endcase |
---|
| 378 | END |
---|
| 379 | 'z':BEGIN |
---|
| 380 | case 1 of |
---|
| 381 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'xy' ; xyz array |
---|
| 382 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'yt' ; (x)yzt array |
---|
| 383 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'xt' ; x(y)zt array |
---|
| 384 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 385 | endcase |
---|
| 386 | END |
---|
| 387 | 't':BEGIN |
---|
| 388 | case 1 of |
---|
| 389 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'xy' ; xyt array |
---|
| 390 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'yz' ; (x)yzt array |
---|
| 391 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'xz' ; x(y)zt array |
---|
| 392 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 393 | endcase |
---|
| 394 | END |
---|
| 395 | 'xy':BEGIN |
---|
| 396 | case 1 OF |
---|
| 397 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'z' ; xyz array |
---|
| 398 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 't' ; xyt array |
---|
| 399 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 400 | endcase |
---|
| 401 | END |
---|
| 402 | 'xz':BEGIN |
---|
| 403 | case 1 of |
---|
| 404 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'y' ; xyz array |
---|
| 405 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 't' ; x(y)zt |
---|
| 406 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
| 407 | endcase |
---|
| 408 | END |
---|
| 409 | 'yz':BEGIN |
---|
| 410 | case 1 of |
---|
| 411 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz:direc = 'x' ; xyz array |
---|
| 412 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 't' ; (x)yzt |
---|
[231] | 413 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
[37] | 414 | endcase |
---|
| 415 | END |
---|
| 416 | 'xt':BEGIN |
---|
| 417 | case 1 of |
---|
| 418 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'y' ; xyt array |
---|
| 419 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'z' ; x(y)zt array |
---|
[231] | 420 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
[37] | 421 | endcase |
---|
| 422 | END |
---|
| 423 | 'yt':BEGIN |
---|
| 424 | case 1 of |
---|
| 425 | sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt:direc = 'x' ; xyt array |
---|
| 426 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'z' ; (x)yzt array |
---|
[231] | 427 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
[37] | 428 | endcase |
---|
| 429 | END |
---|
| 430 | 'zt':BEGIN |
---|
| 431 | case 1 of |
---|
| 432 | sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'x' ; x(y)zt array |
---|
| 433 | nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt:direc = 'y' ; (x)yzt array |
---|
[231] | 434 | ELSE:return, err_3d(type, sz, nx, ny, nz) |
---|
[37] | 435 | ENDCASE |
---|
[231] | 436 | END |
---|
| 437 | ENDCASE |
---|
| 438 | END |
---|
[2] | 439 | ;-------------------------------------------------------------- |
---|
[231] | 440 | 4:BEGIN |
---|
[37] | 441 | CASE type OF |
---|
| 442 | 'x':direc = 'yzt' |
---|
| 443 | 'y':direc = 'xzt' |
---|
| 444 | 'z':direc = 'xyt' |
---|
| 445 | 't':direc = 'xyz' |
---|
| 446 | 'xy':direc = 'zt' |
---|
| 447 | 'xz':direc = 'yt' |
---|
| 448 | 'yz':direc = 'xt' |
---|
| 449 | 'xt':direc = 'yz' |
---|
| 450 | 'yt':direc = 'xz' |
---|
| 451 | 'zt':direc = 'xy' |
---|
[231] | 452 | ENDCASE |
---|
[37] | 453 | END |
---|
| 454 | ENDCASE |
---|
| 455 | ;-------------------------------------------------------------- |
---|
| 456 | IF keyword_set(direc) THEN BEGIN |
---|
| 457 | IF strpos(direc, 't') NE -1 OR strpos(type, 't') NE -1 THEN $ |
---|
| 458 | arr = grossemoyenne(temporary(arr), direc, boxzoom = localbox $ |
---|
| 459 | , NAN = nan, /NODOMDEF, WDEPTH = wdepth, _extra = ex) $ |
---|
| 460 | ELSE arr = moyenne(temporary(arr), direc, boxzoom = localbox $ |
---|
| 461 | , NAN = nan, /NODOMDEF, WDEPTH = wdepth, _extra = ex) |
---|
| 462 | ENDIF |
---|
| 463 | RETURN, arr |
---|
| 464 | END |
---|