[2] | 1 | ;+ |
---|
| 2 | ; |
---|
[226] | 3 | ; @file_comments |
---|
[142] | 4 | ; Trace vertical graphs. |
---|
[2] | 5 | ; |
---|
[226] | 6 | ; @categories |
---|
[142] | 7 | ; Graphics |
---|
[2] | 8 | ; |
---|
[226] | 9 | ; @param TAB |
---|
[142] | 10 | ; The field whose we want to make a vertical cut can be 2 kind of thing: |
---|
[226] | 11 | ; 1) An 2d or 3d array. |
---|
| 12 | ; If the field is 2d, indicate, with the keyword BOXZOOM, geographic delineations of the boxzoom. |
---|
[142] | 13 | ; If the field is 3d, we extract the section on we average possibly before to do the plot. |
---|
[231] | 14 | ; 2) a structure respecting all criterions specified by <pro>litchamp</pro>. |
---|
[163] | 15 | ; See IDL> xhelp,'litchamp'. The array contained in the structure must be 2 or 3d (See case 1) |
---|
[2] | 16 | ; |
---|
[226] | 17 | ; |
---|
[264] | 18 | ; @param GIVENTYPE |
---|
[2] | 19 | ; |
---|
[264] | 20 | ; @param GIVENMIN {required} |
---|
| 21 | ; valeur minimum que l'on veut prendre en compte dans le trace |
---|
[2] | 22 | ; des contours. Par defaut on prend le min de tab1 (sur les pts mer) |
---|
| 23 | ; |
---|
[264] | 24 | ; @param GIVENMAX {required} |
---|
[265] | 25 | ; valeur maximum que l'on veut prendre en compte dans le trace |
---|
[264] | 26 | ; des contours. Par defaut on prend le max de tab1 (sur les pts mer) |
---|
| 27 | ; |
---|
[226] | 28 | ; @keyword BOXZOOM |
---|
| 29 | ; Vector indicating the geographic zone on which we want to cut the map. |
---|
[142] | 30 | ; If BOXZOOM has : |
---|
| 31 | ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] |
---|
| 32 | ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] |
---|
| 33 | ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] |
---|
| 34 | ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] |
---|
| 35 | ; 6 elements: The extraction is made on Boxzoom |
---|
[2] | 36 | ; |
---|
[254] | 37 | ; Where lon1, lon2,lat1,lat2 are global variables defined at the last |
---|
| 38 | ; <pro>domdef</pro> ! |
---|
[2] | 39 | ; |
---|
[226] | 40 | ; @keyword CONTINTERVALLE |
---|
| 41 | ; When CONTOUR is activated, it is the value between 2 isolines |
---|
| 42 | ; traced by a trait. So it can be different from the one specified by INTERVALLE which, |
---|
| 43 | ; in this case, does not control colored isolines in color anymore. If there is noone |
---|
| 44 | ; specified min, we choose a contour min which goes well with the specified interval! |
---|
| 45 | ; If this keyword is not specified, we trace 20 isolines from the min to the max. |
---|
[2] | 46 | ; |
---|
[163] | 47 | ; @keyword CONTLABEL {type=integer} |
---|
| 48 | ; When CONTOUR is activated, if n |
---|
[226] | 49 | ; is different of 0, choose the label type corresponding to n cases for |
---|
| 50 | ; the traced by a traitisolines. To specify the type of label of the |
---|
[142] | 51 | ; colored contour, use LABEL |
---|
[2] | 52 | ; |
---|
[163] | 53 | ; @keyword CONTMAX {default=max of the keyword CONTOUR (on ocean points)} |
---|
[226] | 54 | ; When CONTOUR is activated, max value we want to consider in the isoline |
---|
[163] | 55 | ; traced by a trait's line. |
---|
[2] | 56 | ; |
---|
[163] | 57 | ; @keyword CONTMIN {default=min of the keyword CONTOUR (on ocean points)} |
---|
[226] | 58 | ; When CONTOUR is activated, min value we want to consider in the isoline |
---|
| 59 | ; traced by a trait's line. |
---|
[2] | 60 | ; |
---|
[163] | 61 | ; @keyword CONTNLEVEL {default=20} |
---|
| 62 | ; When CONTOUR is activated, it is the number of contours |
---|
[142] | 63 | ; traced by a trait for drawing (active if |
---|
[163] | 64 | ; CONTLABEL=0). |
---|
[2] | 65 | ; |
---|
[226] | 66 | ; @keyword CONTOUR |
---|
| 67 | ; If we want to trace contours of a different field than the one |
---|
| 68 | ; whose we have the colored drawing (by example E-P in color and QSR in contours). |
---|
[163] | 69 | ; It must be a field respecting same characteristics than the argument number one of plt. |
---|
[2] | 70 | ; |
---|
[226] | 71 | ; @keyword ENDPOINTS |
---|
| 72 | ; keyword specifying that we want to make a vertical cut in diagonal. Then coordinated of extremities |
---|
| 73 | ; of these one are defined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are |
---|
| 74 | ; coordinates. |
---|
[2] | 75 | ; |
---|
[226] | 76 | ; @keyword INTERVALLE |
---|
[264] | 77 | ; Value of an interval between two isolines. If there is none specified min, |
---|
[226] | 78 | ; we choose a min contour which goes well with the specified interval!. If this keyword is not |
---|
| 79 | ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, |
---|
[264] | 80 | ; INTERVALLE only specify the interval between 2 colored isolines. To specify the interval |
---|
[142] | 81 | ; between 2 isolines traced by a trait, use CONTINTERVALLE. |
---|
[35] | 82 | ; |
---|
[226] | 83 | ; @keyword INV |
---|
| 84 | ; Invert the color vector used to color the graph |
---|
[142] | 85 | ; (without use the black, the white and the used palette) |
---|
[35] | 86 | ; |
---|
[163] | 87 | ; @keyword ZRATIO {default=2./3} |
---|
[226] | 88 | ; When the drawing has a zoomed part, it is the size rapport between the zoomed part, |
---|
[163] | 89 | ; hz (zoom height), and the whole drawing, ht (total height). |
---|
[35] | 90 | ; |
---|
[163] | 91 | ; @keyword LABEL {default=0}{type=integer} |
---|
[231] | 92 | ; It choose the label's type corresponding to cases in <pro>label</pro> |
---|
[226] | 93 | ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. |
---|
| 94 | ; For these one traced by a trait, use CONTLABEL. |
---|
[35] | 95 | ; |
---|
[226] | 96 | ; @keyword MAXIN |
---|
[152] | 97 | ; to specify the max value we want to plot with a keyword instead of with the |
---|
| 98 | ; input parameter max. If max is defined by both, parameter and keyword, the |
---|
| 99 | ; keyword is retained. |
---|
[2] | 100 | ; |
---|
[226] | 101 | ; @keyword MININ |
---|
[152] | 102 | ; to specify the min value we want to plot with a keyword instead of with the |
---|
| 103 | ; input parameter min. If min is defined by both, parameter and keyword, the |
---|
| 104 | ; keyword is retained. |
---|
[2] | 105 | ; |
---|
[163] | 106 | ; @keyword NLEVEL {default=20} |
---|
[264] | 107 | ; Number of contours to draw. active if |
---|
[142] | 108 | ; LABEL=0 or is not specified. |
---|
[226] | 109 | ; |
---|
[246] | 110 | ; @keyword NOFILL |
---|
| 111 | ; To make just isolines with no filling |
---|
| 112 | ; |
---|
[226] | 113 | ; @keyword NOTRI |
---|
| 114 | ; To force not to use the triangulation. Beware, in this case, the |
---|
| 115 | ; drawing only works if the grid is undeformed (It means that each point of a longitude |
---|
| 116 | ; give one latitude and each point of a latitude give one longitude) except if we use |
---|
| 117 | ; the keyword CELL_FILL=2. |
---|
[142] | 118 | ; Comment: if the field contain points !values.f_nan, then we even do a triangulation. |
---|
[2] | 119 | ; |
---|
[226] | 120 | ; @keyword OVERPLOT |
---|
| 121 | ; To make a plot over an other one. |
---|
| 122 | ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword |
---|
[142] | 123 | ; does not the caption and/or the color bar. |
---|
[2] | 124 | ; |
---|
[226] | 125 | ; @keyword SIN |
---|
| 126 | ; Activate this keyword if we want the x axis to be traced in sinus of the |
---|
[142] | 127 | ; latitude when we make a drawing f(y) |
---|
[2] | 128 | ; |
---|
[226] | 129 | ; @keyword STRICTFILL |
---|
| 130 | ; Activate this keyword to that the filling of contours be |
---|
[326] | 131 | ; precisely done between the min and the max specified. Values inferior/superior at the |
---|
| 132 | ; specified min/max are not filled. Note that max values a considered |
---|
| 133 | ; as missing values so cells containing one or more corners with |
---|
| 134 | ; values above max will have no contours drawn through them. |
---|
[2] | 135 | ; |
---|
[163] | 136 | ; @keyword STYLE {default=style=0} |
---|
[299] | 137 | ; Contour's style to adopt to draw isolines. See <pro>style</pro> for more informations |
---|
[2] | 138 | ; |
---|
[226] | 139 | ; @keyword WDEPTH |
---|
| 140 | ; To specify that the field is at W depth instead of T |
---|
[142] | 141 | ; depth (automatically activated if vargrid eq 'W') |
---|
[2] | 142 | ; |
---|
[142] | 143 | ; @keyword XZ |
---|
| 144 | ; Force to make a cut following xz |
---|
[2] | 145 | ; |
---|
[142] | 146 | ; @keyword YZ |
---|
| 147 | ; Force to make a cut following yz |
---|
[2] | 148 | ; |
---|
[163] | 149 | ; @keyword ZOOM {default=200m or max depth if it is inferior at 200m} |
---|
| 150 | ; Depth where i can make our maximum zoom. |
---|
[2] | 151 | ; |
---|
[142] | 152 | ; @uses |
---|
| 153 | ; common.pro |
---|
[2] | 154 | ; |
---|
[142] | 155 | ; @history |
---|
[157] | 156 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[142] | 157 | ; 7/1999 |
---|
| 158 | ; Sebastien Masson 08/02/2000 checkfield and |
---|
| 159 | ; notri keyword. |
---|
[2] | 160 | ; |
---|
[142] | 161 | ; @version |
---|
| 162 | ; $Id$ |
---|
[2] | 163 | ; |
---|
[264] | 164 | ; @todo |
---|
[297] | 165 | ; seb definition of paramaters L.215 à 221 |
---|
[2] | 166 | ; |
---|
| 167 | ;- |
---|
[327] | 168 | PRO pltz, tab, giventype, givenmin, givenmax $ |
---|
| 169 | , BOXZOOM=boxzoom, CONTOUR=contour $ |
---|
| 170 | , ENDPOINTS=endpoints, INTERVALLE=intervalle, INV=inv $ |
---|
| 171 | , ZRATIO=zratio $ |
---|
| 172 | , CONTINTERVALLE=contintervalle, LABEL=label, CONTLABEL=contlabel $ |
---|
| 173 | , STYLE=style, CONTMAX=contmax, SIN=sin, TYPEIN=typein $ |
---|
| 174 | , CONTMIN=contmin, NLEVEL=nlevel, CONTNLEVEL=contnlevel $ |
---|
| 175 | , NOFILL=nofill, NOTRI=notri, USETRI=usetri, FILLXDIR=fillxdir $ |
---|
| 176 | , ZOOM=zoom, XZ=xz, YZ=yz, MININ=minin, MAXIN=maxin $ |
---|
| 177 | , STRICTFILL=strictfill, OVERPLOT=overplot, MASKFILL=maskfill $ |
---|
| 178 | , WDEPTH=wdepth, REALSECTION=realsection $ |
---|
| 179 | , _EXTRA=ex |
---|
[114] | 180 | ; |
---|
| 181 | compile_opt idl2, strictarrsubs |
---|
| 182 | ; |
---|
[35] | 183 | @cm_4mesh |
---|
| 184 | @cm_4data |
---|
| 185 | @cm_4ps |
---|
| 186 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
| 187 | @updatenew |
---|
| 188 | @updatekwd |
---|
| 189 | ENDIF |
---|
| 190 | ;-------------------------------------------------------------- |
---|
[142] | 191 | tempsun = systime(1) ; For key_performance |
---|
[2] | 192 | ;------------------------------------------------------------ |
---|
| 193 | ;-------------------------------------------------------------- |
---|
[142] | 194 | ; 1st part: initialization small calculations... |
---|
[2] | 195 | ;-------------------------------------------------------------- |
---|
[295] | 196 | ; Comment: we do not reinitialize when we call back plt in loop to use contour. |
---|
[35] | 197 | if n_elements(contour) ne 4 AND NOT keyword_set(overplot) then reinitplt |
---|
[2] | 198 | ; |
---|
[35] | 199 | if n_elements(contour) ne 4 THEN saveboxparam, 'boxparam4pltz.dat' |
---|
[2] | 200 | ;-------------------------------------------------------------- |
---|
[142] | 201 | ; Reading of the field. |
---|
[2] | 202 | ;-------------------------------------------------------------- |
---|
[35] | 203 | if n_elements(giventype) NE 0 then type = giventype |
---|
| 204 | if n_elements(givenmin) NE 0 then min = givenmin |
---|
| 205 | if n_elements(givenmax) NE 0 then max = givenmax |
---|
| 206 | if n_elements(minin) NE 0 then min = minin |
---|
| 207 | if n_elements(maxin) NE 0 then max = maxin |
---|
| 208 | if n_elements(realsection) EQ 0 then realsection = 1 |
---|
| 209 | IF n_elements(usetri) EQ 0 THEN BEGIN |
---|
| 210 | IF n_elements(notri) NE 0 THEN usetri = 2-notri ELSE usetri = 1 |
---|
| 211 | ENDIF |
---|
| 212 | ; no need of triangulation |
---|
| 213 | IF usetri EQ 1 AND keyword_set(realsection) THEN usetri = 0 |
---|
| 214 | ; did we specify the type ? |
---|
[226] | 215 | if keyword_set(typein) then BEGIN |
---|
[35] | 216 | if size(type, /type) NE 7 AND size(type, /type) NE 0 then begin |
---|
| 217 | if n_elements(min) NE 0 then max = min |
---|
| 218 | min = type |
---|
| 219 | endif |
---|
| 220 | type = typein |
---|
| 221 | ENDIF |
---|
[226] | 222 | ; |
---|
[35] | 223 | checktypeminmax, 'pltz', TYPE = type, MIN = min, MAX = max $ |
---|
| 224 | , XZ = xz, YZ = yz, ENDPOINTS = endpoints, _extra = ex |
---|
| 225 | ; |
---|
| 226 | if keyword_set(endpoints) then begin |
---|
[226] | 227 | section, tab, z2d, glam, gphi, ENDPOINTS = endpoints, TYPE = type $ |
---|
[35] | 228 | , BOXZOOM = boxzoom, DIREC = direc, WDEPTH = wdepth, _extra = ex |
---|
[251] | 229 | if n_elements(z2d) EQ 1 AND z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN |
---|
[35] | 230 | restoreboxparam, 'boxparam4pltz.dat' |
---|
| 231 | return |
---|
| 232 | ENDIF |
---|
[226] | 233 | nx = n_elements(glam) |
---|
[35] | 234 | ny = nx |
---|
| 235 | if strupcase(vargrid) EQ 'W' then begin |
---|
| 236 | gdep = gdepw[firstzw:lastzw] |
---|
| 237 | nz = nzw |
---|
| 238 | ENDIF ELSE BEGIN |
---|
| 239 | gdep = gdept[firstzt:lastzt] |
---|
| 240 | nz = nzt |
---|
| 241 | ENDELSE |
---|
| 242 | mask = z2d LE valmask/10. |
---|
| 243 | ENDIF ELSE BEGIN |
---|
| 244 | z2d = checkfield(tab, 'pltz', TYPE = type, BOXZOOM = boxzoom $ |
---|
| 245 | , DIREC = direc, WDEPTH = wdepth, _extra = ex) |
---|
[251] | 246 | if n_elements(z2d) EQ 1 AND z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN |
---|
[35] | 247 | restoreboxparam, 'boxparam4pltz.dat' |
---|
| 248 | return |
---|
| 249 | ENDIF |
---|
[172] | 250 | IF realsection EQ 1 THEN grille, mask, glam, gphi, gdep, nx, ny, nz, type = type, WDEPTH = wdepth $ |
---|
[35] | 251 | ELSE grille, mask, glam, gphi, gdep, nx, ny, nz, WDEPTH = wdepth |
---|
| 252 | ENDELSE |
---|
[172] | 253 | IF size(gdep, /n_dimensions) EQ 2 THEN usetri = 2 |
---|
[2] | 254 | ;--------------------------------------------------------------- |
---|
[35] | 255 | profmax = !y.range[0] |
---|
| 256 | profmin = !y.range[1] |
---|
| 257 | if not keyword_set(zoom) then zoom = 200 |
---|
| 258 | zoom = zoom[0] |
---|
| 259 | IF zoom LT profmin THEN zoom = profmax |
---|
| 260 | if zoom GE vert2 then zoom = profmax |
---|
| 261 | ; construction of the mask and of the axis |
---|
| 262 | axis4pltz, type, mask, glam, gphi, gdep, XXAXIS = xxaxis, ZZAXIS = zzaxis, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex |
---|
| 263 | ; to draw from bottom to top (avoid using cell_fill) |
---|
| 264 | z2d = reverse(z2d, 2) |
---|
[2] | 265 | ;----------------------------------------------------------------------------- |
---|
[226] | 266 | ; Determination of the mi:min and of the ma:max of z2d in the same way |
---|
[142] | 267 | ; as max: max and min: min for the drawing. |
---|
[2] | 268 | ;----------------------------------------------------------------------------- |
---|
[35] | 269 | nan = total(finite(z2d, /nan)) < 1 |
---|
[142] | 270 | ; Do we need to do an autoscale ??? |
---|
[35] | 271 | autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle) |
---|
| 272 | determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle, _extra = ex |
---|
[251] | 273 | if n_elements(z2d) EQ 1 AND z2d[0] EQ -1 THEN GOTO, sortie |
---|
[142] | 274 | ; We do an autoscale if needed. |
---|
[35] | 275 | if autoscale then autoscale, min, max, intervalle |
---|
[2] | 276 | ;-------------------------------------------------------------- |
---|
| 277 | ;-------------------------------------------------------------- |
---|
[142] | 278 | ; 2nd part: drawing |
---|
[2] | 279 | ;-------------------------------------------------------------- |
---|
| 280 | ;-------------------------------------------------------------- |
---|
[35] | 281 | if n_elements(contour) NE 4 AND NOT keyword_set(overplot) THEN $ |
---|
| 282 | placedessin, 'pltz', posfenetre, posbar, contour = contour, endpoints = endpoints $ |
---|
[2] | 283 | , direc = direc, _extra = ex |
---|
| 284 | ;------------------------------------------------------------ |
---|
| 285 | ;-------------------------------------------------------------- |
---|
[142] | 286 | ; choice of labels |
---|
[2] | 287 | ;----------------------------------------------------------- |
---|
[35] | 288 | if keyword_set(intervalle) AND NOT keyword_set(label) then label = 1 |
---|
| 289 | if keyword_set(label) eq 0 then cas = 0 else cas = label |
---|
| 290 | label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL = nlevel $ |
---|
| 291 | , INTERVALLE = intervalle, strictfill = strictfill |
---|
[2] | 292 | ;-------------------------------------------------------------- |
---|
[142] | 293 | ; choice of style |
---|
[2] | 294 | ;----------------------------------------------------------- |
---|
[35] | 295 | if not keyword_set(style) then style = 0 |
---|
| 296 | style, style, level_z2d, linestyle, thick |
---|
| 297 | if keyword_set(inv) then colnumb = reverse(colnumb) |
---|
[2] | 298 | ;----------------------------------------------------------- |
---|
[142] | 299 | ; definition of axes |
---|
[2] | 300 | ;---------------------------------------------------------- |
---|
[35] | 301 | if NOT keyword_set(overplot) THEN axe, type, SIN = sin, _EXTRA = ex |
---|
| 302 | !y.range = [-1, 0] |
---|
[2] | 303 | ;-------------------------------------------------------------- |
---|
[297] | 304 | ; extrapolation of data on lands and specifying of the min/max value |
---|
[2] | 305 | ;-------------------------------------------------------------- |
---|
[35] | 306 | ; define masknan |
---|
| 307 | if keyword_set(nan) then BEGIN |
---|
| 308 | masknan = finite(z2d) |
---|
[246] | 309 | IF NOT keyword_set(nofill) THEN z2d[where(masknan EQ 0)] = max |
---|
[35] | 310 | ENDIF ELSE masknan = 1 |
---|
[326] | 311 | IF keyword_set(strictfill) THEN BEGIN |
---|
| 312 | tmp = z2d ge max |
---|
[328] | 313 | IF total(tmp GE 1) THEN BEGIN |
---|
| 314 | tmp = 1b - byte(extrapolate(tmp, tmp, 1)) |
---|
| 315 | key_save = key_periodic & key_periodic = 0 |
---|
| 316 | trifield = triangule(temporary(tmp)*mask, coinmonte = coinmontemask $ |
---|
| 317 | , coindescend = coindescendmask, keep_cont = 0) |
---|
| 318 | key_periodic = key_save |
---|
| 319 | ENDIF |
---|
[326] | 320 | ENDIF |
---|
[35] | 321 | IF n_elements(fillxdir) EQ 0 THEN fillxdir = 1 |
---|
| 322 | IF keyword_set(fillxdir) THEN BEGIN |
---|
| 323 | ; filling the mask values only in the x direction. |
---|
| 324 | z2d = remplit(z2d, nite = nx*(1-(n_elements(maskfill) NE 0)) $ |
---|
| 325 | , mask = mask*masknan, /basique $ |
---|
| 326 | , /fillxdir, _extra = ex) |
---|
[142] | 327 | ; if some lines contains no field (the bottom line for ex) it must be |
---|
[295] | 328 | ; also filled with 8 neighbors method |
---|
[35] | 329 | IF (where(total(mask*masknan, 1) EQ 0))[0] NE -1 THEN $ |
---|
| 330 | z2d = remplit(z2d, nite = 1-(n_elements(maskfill) NE 0) $ |
---|
| 331 | , mask = z2d LT valmask/10, /basique, _extra = ex) |
---|
[226] | 332 | ENDIF ELSE BEGIN |
---|
[295] | 333 | ; filling the mask values with 8 neighbors |
---|
[35] | 334 | z2d = remplit(z2d, nite = (1+(vargrid NE 'T')+keyword_set(nan)) $ |
---|
| 335 | *(1-(n_elements(maskfill) NE 0)), mask = mask*masknan $ |
---|
| 336 | , /basique, _extra = ex) |
---|
[226] | 337 | ENDELSE |
---|
[35] | 338 | if keyword_set(strictfill) EQ 0 AND n_elements(maskfill) EQ 0 $ |
---|
| 339 | then z2d = min > z2d < max |
---|
| 340 | if n_elements(maskfill) NE 0 then BEGIN |
---|
| 341 | z2d = z2d*mask*masknan |
---|
| 342 | if maskfill NE 0 then z2d = temporary(z2d) + maskfill*(1b-mask*masknan) |
---|
| 343 | ENDIF |
---|
| 344 | ;---------------------------------------------------------- |
---|
[226] | 345 | ; check the mask and the triangulation according to the grid type and |
---|
[35] | 346 | ; nan values. find the coordinates of the mask |
---|
[226] | 347 | ;---------------------------------------------------------- |
---|
[35] | 348 | ; if (where(mask EQ 0))[0] EQ -1 AND NOT keyword_set(nan) then notri = 1 |
---|
| 349 | ; if keyword_set(notri) then trifield = -1 $ |
---|
| 350 | ; ELSE trifield = triangule(mask,/basic) |
---|
[328] | 351 | if n_elements(key_save) EQ 0 AND ((usetri GE 1 AND (vargrid EQ 'T' OR vargrid EQ 'W')) $ |
---|
[326] | 352 | OR (usetri EQ 2 AND (vargrid NE 'T' AND vargrid NE 'W'))) THEN $ |
---|
| 353 | trifield = triangule(mask, /basic) |
---|
[35] | 354 | ; |
---|
| 355 | IF NOT keyword_set(endpoints) THEN BEGIN |
---|
| 356 | if keyword_set(nan) then trinan = triangule(masknan, /basic, coinmonte = coinmontenan, coindescend = coindescendnan) |
---|
[171] | 357 | maskorg = mask |
---|
[35] | 358 | decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection |
---|
| 359 | axis4pltz, type, mask, glammsk, gphimsk, gdepmsk, XXAXIS = xmask, ZZAXIS = zmask, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex |
---|
| 360 | ENDIF ELSE BEGIN |
---|
| 361 | xmask = xxaxis |
---|
| 362 | zmask = zzaxis |
---|
[226] | 363 | ENDELSE |
---|
[35] | 364 | ; |
---|
[226] | 365 | if (usetri GE 1 AND (vargrid NE 'T' AND vargrid NE 'W')) THEN BEGIN |
---|
[35] | 366 | IF keyword_set(realsection) THEN trimsk = triangule(mask, /basic) $ |
---|
| 367 | ELSE trimsk = triangule(mask, /basic, coinmonte = coinmontemask $ |
---|
| 368 | , coindescend = coindescendmask) |
---|
[226] | 369 | ENDIF |
---|
[2] | 370 | ;------------------------------------------------------------ |
---|
| 371 | ; dessin en lui meme |
---|
| 372 | ;------------------------------------------------------------ |
---|
[172] | 373 | IF n_elements(romszinfos) EQ 1 THEN BEGIN |
---|
| 374 | ; add one line at bottom to have nicer plot (colors go until the ocean bottom) |
---|
| 375 | IF n_elements(romszinfos.h) NE 1 THEN BEGIN |
---|
| 376 | CASE type OF |
---|
| 377 | 'xz':romsh = moyenne(romszinfos.h, 'y') |
---|
| 378 | 'yz':romsh = moyenne(romszinfos.h, 'x') |
---|
| 379 | ENDCASE |
---|
| 380 | IF nzt EQ jpk THEN BEGIN |
---|
| 381 | z2d = [[z2d], [z2d[*, jpk-1]]] |
---|
| 382 | zzaxis = [[zzaxis], [romsh]] |
---|
| 383 | ENDIF |
---|
| 384 | ENDIF |
---|
| 385 | ENDIF |
---|
[35] | 386 | pltbase, z2d, xxaxis, zzaxis, mask, xmask, zmask $ |
---|
| 387 | , level_z2d, colnumb, overplot = overplot $ |
---|
| 388 | , contour = contour, trichamp = trifield, trimsk = trimsk $ |
---|
| 389 | , c_linestyle = linestyle $ |
---|
| 390 | , c_labels = 1-(indgen(n_elements(level_z2d)) MOD 2) $ |
---|
[246] | 391 | , c_thick = thick, unsur2 = unsur2, NOFILL = nofill $ |
---|
[171] | 392 | , maskorg = maskorg, masknan = masknan, trinan = trinan $ |
---|
[35] | 393 | , coinmontenan = coinmontenan, coindescendnan = coindescendnan $ |
---|
| 394 | , coinmontemask = coinmontemask, coindescendmask = coindescendmask $ |
---|
| 395 | , REALSECTION = realsection, USETRI = usetri, _extra = ex |
---|
[2] | 396 | ;------------------------------------------------------------ |
---|
[142] | 397 | ; recall of pltz in loop when contour is activated |
---|
[2] | 398 | ;------------------------------------------------------------ |
---|
[142] | 399 | if n_elements(contour) eq 4 then BEGIN ; It is the second time I pass in pltt |
---|
| 400 | contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; I send back the min, the max and the unity |
---|
[35] | 401 | return |
---|
| 402 | endif |
---|
[226] | 403 | if keyword_set(contour) THEN BEGIN |
---|
[35] | 404 | pourlegende = [1, 1, 1, 1] |
---|
| 405 | oldattributs = saveatt() |
---|
| 406 | oldcolnumb = colnumb |
---|
| 407 | pltz, contour, contmin, contmax, CONTOUR = pourlegende, ZRATIO = zratio $ |
---|
| 408 | , INTERVALLE = contintervalle, LABEL = contlabel, STYLE = style, /noerase $ |
---|
| 409 | , NLEVEL = contnlevel, ZOOM = zoom, BOXZOOM = boxzoom, ENDPOINTS = endpoints $ |
---|
| 410 | , STRICTFILL = strictfill, REALSECTION = realsection, MASKFILL = maskfill $ |
---|
| 411 | , USETRI = usetri, WDEPTH = wdepth, _extra = ex |
---|
| 412 | restoreatt, oldattributs |
---|
| 413 | colnumb = oldcolnumb |
---|
| 414 | ENDIF |
---|
[2] | 415 | ;------------------------------------------------------------ |
---|
| 416 | ;------------------------------------------------------------ |
---|
[142] | 417 | ; 3rd part: drawing of the frame, caption, colorbar... |
---|
[2] | 418 | ;------------------------------------------------------------ |
---|
[226] | 419 | if keyword_set(overplot) then BEGIN |
---|
[142] | 420 | !y.range = [zoom, profmin] ; We get back on physic coordinates |
---|
[35] | 421 | plot, [0], [0], /nodata, /noerase, title = '', subtitle = '', xstyle = 5, ystyle = 5 |
---|
| 422 | GOTO, fini |
---|
| 423 | endif |
---|
[2] | 424 | ;------------------------------------------------------------ |
---|
[226] | 425 | ; Caption + display of them |
---|
[2] | 426 | ;------------------------------------------------------------ |
---|
[35] | 427 | legende, mi, ma, type, CONTOUR = pourlegende, INTERVALLE = intervalle, DIREC = direc, endpoints = endpoints, _EXTRA = ex |
---|
| 428 | if type eq 'yz' then xaxe = 'lataxe' else xaxe = 'lonaxe' |
---|
| 429 | if keyword_set(sin) OR NOT key_onearth then xaxe = '' |
---|
[142] | 430 | ; Frame applied by default |
---|
[35] | 431 | plot, [xxaxis[0], xxaxis[n_elements(xxaxis)-1]], [-zratio, -zratio], /noerase $ |
---|
| 432 | , xstyle = 1+4*(keyword_set(endpoints) AND ((type EQ 'xz' AND lat1 NE lat2) OR (type EQ 'yz' AND lon1 NE lon2))) $ |
---|
| 433 | , xtickformat = xaxe, _extra = ex |
---|
[142] | 434 | ; Add of an axis in the case of we use endpoints |
---|
[35] | 435 | if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex |
---|
[2] | 436 | ;------------------------------------------------------------ |
---|
[142] | 437 | ; Y axis in 1 or 2 part |
---|
[2] | 438 | ;------------------------------------------------------------ |
---|
[226] | 439 | if n_elements(ex) NE 0 then BEGIN |
---|
[142] | 440 | ; To do not put title anymore |
---|
[35] | 441 | if (where(tag_names(ex) EQ 'TITLE'))[0] NE -1 then ex.TITLE = ' ' |
---|
[142] | 442 | ; To do not put subtitle anymore |
---|
[35] | 443 | if (where(tag_names(ex) EQ 'SUBTITLE'))[0] NE -1 then ex.SUBTITLE = ' ' |
---|
[142] | 444 | ; To have just one ytitle |
---|
[226] | 445 | if (where(tag_names(ex) EQ 'YTITLE'))[0] NE -1 then BEGIN |
---|
[35] | 446 | ytitle = ex.YTITLE |
---|
| 447 | ex.YTITLE = ' ' |
---|
| 448 | endif |
---|
| 449 | ENDIF |
---|
| 450 | htotal = posfenetre[3]-posfenetre[1] |
---|
| 451 | hzoom = 1.*zratio*htotal |
---|
| 452 | if zoom LT profmax then $ |
---|
| 453 | plot, [0], [0], /nodata, /noerase, ystyle = 1, yrange = [profmax, zoom+0.001] $ |
---|
| 454 | , position = posfenetre+[0, 0, 0, -hzoom], _extra = ex, title = '', subtitle = '', ytitle = '' |
---|
[2] | 455 | ; |
---|
[142] | 456 | !y.range = [zoom, profmin] ; We get back in physic coordinates! |
---|
[35] | 457 | plot, [0], [0], /nodata, /noerase, ystyle = 1, _extra = ex $ |
---|
| 458 | , title = '', subtitle = '', ytitle = '', position = posfenetre+[0, htotal-hzoom, 0, 0] |
---|
[2] | 459 | ;------------------------------------------------------------ |
---|
[142] | 460 | ; to write the ytitle... |
---|
[2] | 461 | ;------------------------------------------------------------ |
---|
[35] | 462 | if !d.name EQ 'PS' then $ |
---|
| 463 | xs = (max(page_size, min = mi)*(1-key_portrait) + mi*key_portrait)*!d.x_px_cm $ |
---|
| 464 | ELSE xs = !d.x_size |
---|
| 465 | if n_elements(ytitle) NE 0 then !y.title = ytitle |
---|
| 466 | charsize = chkstru(ex, 'ycharsize', /extract) |
---|
| 467 | if charsize EQ -1 then charsize = !p.charsize |
---|
| 468 | IF chkstru(ex, 'charsize') THEN ex.charsize = charsize |
---|
| 469 | if chkstru(ex, 'ytitle', /extract) NE '' then $ |
---|
| 470 | decalage = string(format = '(e10.3)', profmax) |
---|
| 471 | decalage = float(strmid(decalage, strpos(decalage, 'e')+1)) |
---|
| 472 | posy = posfenetre[1]+1.*htotal/2 |
---|
| 473 | posx = posfenetre[0]-(decalage+3)*!d.x_ch_size*charsize/xs |
---|
| 474 | xyouts, posx, posy, !y.title, /normal, orientation = 90, color = 0, ALIGNMENT = .5, charsize = charsize, _extra = ex |
---|
[2] | 475 | |
---|
| 476 | ;------------------------------------------------------------ |
---|
[142] | 477 | ; colorbar |
---|
[2] | 478 | ;------------------------------------------------------------ |
---|
[35] | 479 | colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)] |
---|
| 480 | barrecouleur, colnumb, min, max, (ncontour-keyword_set(strictfill))/2 $ |
---|
| 481 | , position = posbar, _extra = ex |
---|
[2] | 482 | ;------------------------------------------------------------ |
---|
| 483 | ;------------------------------------------------------------ |
---|
[142] | 484 | ; 4th part: possible print |
---|
[2] | 485 | ;------------------------------------------------------------ |
---|
| 486 | ;------------------------------------------------------------ |
---|
| 487 | fini: |
---|
[35] | 488 | terminedessin, _extra = ex |
---|
[2] | 489 | ;------------------------------------------------------------ |
---|
| 490 | ;------------------------------------------------------------ |
---|
| 491 | ;------------------------------------------------------------ |
---|
| 492 | ;------------------------------------------------------------ |
---|
| 493 | sortie: |
---|
[35] | 494 | restoreboxparam, 'boxparam4pltz.dat' |
---|
| 495 | ; |
---|
[226] | 496 | if keyword_set(key_performance) NE 0 THEN print, 'temps pltz', systime(1)-tempsun |
---|
[35] | 497 | return |
---|
[2] | 498 | end |
---|