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