Changeset 226 for trunk/SRC/ToBeReviewed/PLOTS/DESSINE
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/PLOTS/DESSINE
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltbase.pro
r171 r226 5 5 ; 6 6 ; @file_comments 7 ; Overlayer contour to trace a field which can be mask. 7 ; Overlayer contour to trace a field which can be mask. 8 8 ; Elementary brick of plt, pltz et pltt. 9 9 ; 10 ; @categories 10 ; @categories 11 11 ; Graphics 12 12 ; … … 21 21 ; 22 22 ; @param MASK {in}{required}{type=array} 23 ; It is the array who mask z2d (with 0s on points we want to mask and 1s on others). 23 ; It is the array who mask z2d (with 0s on points we want to mask and 1s on others). 24 24 ; If z2d is not masked, put this argument equal to 1. 25 25 ; 26 26 ; @param XM {in}{required} 27 ; Axis of the mask. Vector or array of the same size that mask. 27 ; Axis of the mask. Vector or array of the same size that mask. 28 28 ; This is the coordinate of mask on x. 29 29 ; 30 30 ; @param YM {in}{required} 31 ; Axis of the mask. Vector or array of the same size that mask. 31 ; Axis of the mask. Vector or array of the same size that mask. 32 32 ; This is the coordinate of mask on y. 33 33 ; 34 34 ; @param LEVELS {in}{optional}{type=vector} 35 ; Vectors which contain levels needed at the contour. 35 ; Vectors which contain levels needed at the contour. 36 36 ; If it is not given, we take 20 levels between the min and the max. 37 ; 37 ; 38 38 ; @param COLORS {in}{optional}{type=vector} 39 ; Vectors which contain colors needed at the contour. 39 ; Vectors which contain colors needed at the contour. 40 40 ; If it is not given, we take 20 levels between the min and the max. 41 41 ; 42 ; @keyword COLORTRICHAMP 42 ; @keyword COLORTRICHAMP 43 43 ; The color we want to use to draw the triangulation which is used to make contours of the field. 44 44 ; 45 ; @keyword COLORTRIMASK 45 ; @keyword COLORTRIMASK 46 46 ; The color we want to use to draw the triangulation which is used to make contours of the mask. 47 47 ; 48 ; @keyword COLOR_C 48 ; @keyword COLOR_C 49 49 ; To draw the contour in color instead of in black 50 ; with filling in color 51 ; 52 ; @keyword CONT_NOFILL 53 ; Activate it not to fill the point mask to let them transparent! 50 ; with filling in color 51 ; 52 ; @keyword CONT_NOFILL 53 ; Activate it not to fill the point mask to let them transparent! 54 54 ; Comment: Nevertheless, we trace mask's contour. 55 55 ; … … 57 57 ; The color of the continent. 58 58 ; 59 ; @keyword DESSTRICHAMP 60 ; To draw the triangulation which is used to make field's contours. 61 ; 62 ; @keyword DESSTRIMASK 59 ; @keyword DESSTRICHAMP 60 ; To draw the triangulation which is used to make field's contours. 61 ; 62 ; @keyword DESSTRIMASK 63 63 ; To draw the triangulation which is used to make mask's contours. 64 ; 65 ; @keyword FORPLT 64 ; 65 ; @keyword FORPLT 66 66 ; To activate if we want that the drawing of coast be realized by tracecote rather than tracemask. 67 67 ; 68 68 ; @keyword I_COLORS {type=vector} 69 ; It is a vector specifying the colors to use to trace contours. 69 ; It is a vector specifying the colors to use to trace contours. 70 70 ; It is the same thing that c_colors which act on contours. 71 71 ; … … 74 74 ; % Out of range subscript encountered: <LONG Array[38911]>. 75 75 ; % Execution halted at: PLTBASE 151 76 ; If the bug still exist, increase the value of more! 76 ; If the bug still exist, increase the value of more! 77 77 ; (The explanation and the justification of this method do not have scientific bases yet...). 78 78 ; … … 89 89 ; I specify we only label one contour on two. 90 90 ; 91 ; @keyword CONTOUR 91 ; @keyword CONTOUR 92 92 ; To be used since plt, pltz or pltt. (Have a look on these routines). 93 93 ; 94 ; @keyword _EXTRA 94 ; @keyword _EXTRA 95 95 ; Used to pass your keywords 96 96 ; … … 106 106 ; 8/2/2000 check if the tri array is not equal to 107 107 ; -1. allow contour with out using a triangulation. 108 ; 108 ; 109 109 ; @version 110 110 ; $Id$ … … 146 146 ;--------------------------------------------------------- 147 147 ; 148 ; Explanation concerning contour. This keyword is activated when we trace a 148 ; Explanation concerning contour. This keyword is activated when we trace a 149 149 ; colored contour different from the one with black trait. 150 150 ; If it is activated (case n_elements(contour) NE 0), we pass 2 time in pltbase: 151 151 ; 1) We trace colors then we leave, it is the case: 152 152 ; n_elements(contour) NE 0 AND n_elements(contour) NE 4) 153 ; 2) We trace contours in traits then continents, it is the case: 153 ; 2) We trace contours in traits then continents, it is the case: 154 154 ; n_elements(contour) NE 0 AND n_elements(contour) EQ 4) 155 155 ; … … 162 162 ; If levels and colors aren't given 163 163 ;---------------------------------------------------------------------- 164 if n_params() EQ 4 then $ 164 if n_params() EQ 4 then $ 165 165 label, 0, min(z2d*mask), max(z2d*mask), ncontour, levels, colors 166 166 ; attention bidouille inexplicable pour que tout se passe bien avec les … … 171 171 ; Is cell_fill is a part of _extra, we desactive it if it is nt equal to 2 172 172 ;---------------------------------------------------------------------- 173 IF chkstru(ex, 'CELL_FILL') THEN BEGIN 173 IF chkstru(ex, 'CELL_FILL') THEN BEGIN 174 174 cell_fill = ex.CELL_FILL 175 175 if ex.CELL_FILL NE 2 then ex.CELL_FILL = 0 176 176 ENDIF ELSE cell_fill = 0 ; 177 177 ;---------------------------------------------------------------------- 178 ; I) Filling of contours in palette colors 178 ; I) Filling of contours in palette colors 179 179 ;---------------------------------------------------------------------- 180 180 if NOT keyword_set(more) then more = 10 181 181 if NOT keyword_set(nofill) AND NOT keyword_set(color_c) then begin 182 if n_elements(contour) NE 4 THEN BEGIN 182 if n_elements(contour) NE 4 THEN BEGIN 183 183 if usetri EQ 2 then BEGIN 184 184 IF size(x, /n_dimensions) EQ 1 THEN x = x#replicate(1, (size(z2d))[2]) … … 191 191 IF size(y, /n_dimensions) EQ 2 THEN y = reform(y[0, *]) 192 192 contour, z2d, x, y, levels = levels, c_color = colors, /noerase $ 193 , /fill, _extra = ex 193 , /fill, _extra = ex 194 194 ENDELSE 195 195 ENDIF 196 196 ENDIF 197 if n_elements(contour) NE 0 AND n_elements(contour) NE 4 THEN GOTO, fini 197 if n_elements(contour) NE 0 AND n_elements(contour) NE 4 THEN GOTO, fini 198 198 IF chkstru(ex, 'C_ORIENTATION') THEN ex = extractstru(ex, 'C_ORIENTATION') 199 199 IF chkstru(ex, 'C_SPACING') THEN ex = extractstru(ex, 'C_SPACING') … … 207 207 ; 208 208 IF (n_elements(mask) GT 1 OR n_elements(masknan) GT 1) $ 209 AND NOT keyword_set(cont_nofill) THEN BEGIN 210 IF keyword_set(maskorg) THEN tonan = maskorg*masknan ELSE tonan = mask*masknan 209 AND NOT keyword_set(cont_nofill) THEN BEGIN 210 IF keyword_set(maskorg) THEN tonan = maskorg*masknan ELSE tonan = mask*masknan 211 211 tonan = where(remplit(tonan, nite = 1, mask = tonan $ 212 212 , /basique, fillval = 0 $ 213 213 , fillxdir = keyword_set(realsection)) EQ 0, count) 214 214 IF count NE 0 THEN z2d[temporary(tonan)] = !values.f_nan 215 ENDIF 215 ENDIF 216 216 ; 217 217 ; We do not pass if we have to make differents contours... … … 232 232 ENDCASE 233 233 ; 234 IF usetri EQ 2 THEN BEGIN 234 IF usetri EQ 2 THEN BEGIN 235 235 IF size(x, /n_dimensions) EQ 1 THEN x = x#replicate(1, (size(z2d))[2]) 236 236 IF size(y, /n_dimensions) EQ 1 THEN y = replicate(1, (size(z2d))[1])#y … … 253 253 IF chkstru(ex, 'LEVELS') THEN ex = extractstru(ex, 'LEVELS') 254 254 IF chkstru(ex, 'NODATA') THEN ex = extractstru(ex, 'NODATA') 255 IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) < 255 256 ; 257 ; If there is points at NaN 258 ; We trace points in white at NaN b afore drawing coasts with a trait.255 IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) < 255 256 ; 257 ; If there is points at NaN 258 ; We trace points in white at NaN before drawing coasts with a trait. 259 259 ; 260 260 if keyword_set(trinan) THEN BEGIN … … 298 298 , COINDESCEND = coindescendmask, CONT_COLOR = cont_color, _extra = ex 299 299 END 300 ELSE:BEGIN 300 ELSE:BEGIN 301 301 IF size(xm, /n_dimensions) EQ 2 THEN xm = xm[*, 0] 302 302 IF size(ym, /n_dimensions) EQ 2 THEN ym = reform(ym[0, *]) … … 310 310 ;------------------------------------------------------------ 311 311 case 1 of 312 keyword_set(realsection) AND NOT keyword_set(cont_nofill): 312 keyword_set(realsection) AND NOT keyword_set(cont_nofill): 313 313 keyword_set(realsection) AND keyword_set(cont_nofill): $ 314 314 drawsectionbottom, mask, xm, ym $ … … 334 334 ; 335 335 fini: 336 IF keyword_set(key_performance) THEN print, 'temps pltbase', systime(1)-tempsun 336 IF keyword_set(key_performance) THEN print, 'temps pltbase', systime(1)-tempsun 337 337 338 338 return -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
r172 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Trace vertical graphs. 8 8 ; 9 ; @categories 9 ; @categories 10 10 ; Graphics 11 11 ; 12 ; @param TAB 12 ; @param TAB 13 13 ; The field whose we want to make a vertical cut can be 2 kind of thing: 14 ; 1) An 2d or 3d array. 15 ; If the field is 2d, indicate, with the keyword BOXZOOM, geographic delineations of the boxzoom. 14 ; 1) An 2d or 3d array. 15 ; If the field is 2d, indicate, with the keyword BOXZOOM, geographic delineations of the boxzoom. 16 16 ; If the field is 3d, we extract the section on we average possibly before to do the plot. 17 ; 2) a structure respecting all criterions specified by litchamp.pro. 17 ; 2) a structure respecting all criterions specified by litchamp.pro. 18 18 ; See IDL> xhelp,'litchamp'. The array contained in the structure must be 2 or 3d (See case 1) 19 19 ; 20 20 ; ces arguments ne sont pas obligatoires: 21 ; 21 ; 22 22 ; MAX: valeur maximum que l'on veut prendre en compte dans le trace 23 23 ; des contours. Par defaut on prend le max de tab1 (sur les pts mer) … … 26 26 ; des contours. Par defaut on prend le min de tab1 (sur les pts mer) 27 27 ; 28 ; @keyword BOXZOOM 29 ; Vector indicating the geographic zone on which we want to cut the map. 28 ; @keyword BOXZOOM 29 ; Vector indicating the geographic zone on which we want to cut the map. 30 30 ; If BOXZOOM has : 31 31 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] … … 37 37 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 38 38 ; 39 ; @keyword CONTINTERVALLE 40 ; When CONTOUR is activated, it is the value between 2 isolines 41 ; traced by a trait. So it can be different from the one specified by INTERVALLE which, 42 ; in this case, does not control colored isolines in color anymore. If there is noone 43 ; specified min, we choose a contour min which goes well with the specified interval! 44 ; If this keyword is not specified, we trace 20 isolines from the min to the max. 39 ; @keyword CONTINTERVALLE 40 ; When CONTOUR is activated, it is the value between 2 isolines 41 ; traced by a trait. So it can be different from the one specified by INTERVALLE which, 42 ; in this case, does not control colored isolines in color anymore. If there is noone 43 ; specified min, we choose a contour min which goes well with the specified interval! 44 ; If this keyword is not specified, we trace 20 isolines from the min to the max. 45 45 ; 46 46 ; @keyword CONTLABEL {type=integer} 47 47 ; When CONTOUR is activated, if n 48 ; is different of 0, choose the label type corresponding to n cases for 49 ; the traced by a traitisolines. To specify the type of label of the 48 ; is different of 0, choose the label type corresponding to n cases for 49 ; the traced by a traitisolines. To specify the type of label of the 50 50 ; colored contour, use LABEL 51 51 ; 52 52 ; @keyword CONTMAX {default=max of the keyword CONTOUR (on ocean points)} 53 ; When CONTOUR is activated, max value we want to consider in the isoline 53 ; When CONTOUR is activated, max value we want to consider in the isoline 54 54 ; traced by a trait's line. 55 55 ; 56 56 ; @keyword CONTMIN {default=min of the keyword CONTOUR (on ocean points)} 57 ; When CONTOUR is activated, min value we want to consider in the isoline 58 ; traced by a trait's line. 57 ; When CONTOUR is activated, min value we want to consider in the isoline 58 ; traced by a trait's line. 59 59 ; 60 60 ; @keyword CONTNLEVEL {default=20} … … 63 63 ; CONTLABEL=0). 64 64 ; 65 ; @keyword CONTOUR 66 ; If we want to trace contours of a different field than the one 67 ; whose we have the colored drawing (by example E-P in color and QSR in contours). 65 ; @keyword CONTOUR 66 ; If we want to trace contours of a different field than the one 67 ; whose we have the colored drawing (by example E-P in color and QSR in contours). 68 68 ; It must be a field respecting same characteristics than the argument number one of plt. 69 69 ; 70 ; @keyword ENDPOINTS 71 ; keyword specifying that we want to make a vertical cut in diagonal. Then coordinated of extremities 72 ; of these one are defined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 73 ; coordinates. 74 ; 75 ; @keyword INTERVALLE 76 ; Value of an internal between to isoline. If there is none specified min, 77 ; we choose a min contour which goes well with the specified interval!. If this keyword is not 78 ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, 79 ; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval 70 ; @keyword ENDPOINTS 71 ; keyword specifying that we want to make a vertical cut in diagonal. Then coordinated of extremities 72 ; of these one are defined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 73 ; coordinates. 74 ; 75 ; @keyword INTERVALLE 76 ; Value of an internal between to isoline. If there is none specified min, 77 ; we choose a min contour which goes well with the specified interval!. If this keyword is not 78 ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, 79 ; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval 80 80 ; between 2 isolines traced by a trait, use CONTINTERVALLE. 81 81 ; 82 ; @keyword INV 83 ; Invert the color vector used to color the graph 82 ; @keyword INV 83 ; Invert the color vector used to color the graph 84 84 ; (without use the black, the white and the used palette) 85 85 ; 86 86 ; @keyword ZRATIO {default=2./3} 87 ; When the drawing has a zoomed part, it is the size rapport between the zoomed part, 87 ; When the drawing has a zoomed part, it is the size rapport between the zoomed part, 88 88 ; hz (zoom height), and the whole drawing, ht (total height). 89 89 ; 90 90 ; @keyword LABEL {default=0}{type=integer} 91 91 ; It choose the label's type corresponding to cases in label.pro. 92 ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. 93 ; For these one traced by a trait, use CONTLABEL. 94 ; 95 ; @keyword MAXIN 92 ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. 93 ; For these one traced by a trait, use CONTLABEL. 94 ; 95 ; @keyword MAXIN 96 96 ; to specify the max value we want to plot with a keyword instead of with the 97 97 ; input parameter max. If max is defined by both, parameter and keyword, the 98 98 ; keyword is retained. 99 99 ; 100 ; @keyword MININ 100 ; @keyword MININ 101 101 ; to specify the min value we want to plot with a keyword instead of with the 102 102 ; input parameter min. If min is defined by both, parameter and keyword, the … … 106 106 ; Number of contour to draw by default =20. active if 107 107 ; LABEL=0 or is not specified. 108 ; 109 ; @keyword NOTRI 110 ; To force not to use the triangulation. Beware, in this case, the 111 ; drawing only works if the grid is undeformed (It means that each point of a longitude 112 ; give one latitude and each point of a latitude give one longitude) except if we use 113 ; the keyword CELL_FILL=2. 108 ; 109 ; @keyword NOTRI 110 ; To force not to use the triangulation. Beware, in this case, the 111 ; drawing only works if the grid is undeformed (It means that each point of a longitude 112 ; give one latitude and each point of a latitude give one longitude) except if we use 113 ; the keyword CELL_FILL=2. 114 114 ; Comment: if the field contain points !values.f_nan, then we even do a triangulation. 115 115 ; 116 ; @keyword OVERPLOT 117 ; To make a plot over an other one. 118 ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword 116 ; @keyword OVERPLOT 117 ; To make a plot over an other one. 118 ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword 119 119 ; does not the caption and/or the color bar. 120 120 ; 121 ; @keyword SIN 122 ; Activate this keyword if we want the x axis to be traced in sinus of the 121 ; @keyword SIN 122 ; Activate this keyword if we want the x axis to be traced in sinus of the 123 123 ; latitude when we make a drawing f(y) 124 124 ; 125 ; @keyword STRICTFILL 126 ; Activate this keyword to that the filling of contours be 127 ; precisely done between the min and the max specified letting values inferior at the 125 ; @keyword STRICTFILL 126 ; Activate this keyword to that the filling of contours be 127 ; precisely done between the min and the max specified letting values inferior at the 128 128 ; specified min and values superior at the specified max in white. 129 129 ; … … 131 131 ; Contour's style to adopt to draw isolines 132 132 ; 133 ; @keyword WDEPTH 134 ; To specify that the field is at W depth instead of T 133 ; @keyword WDEPTH 134 ; To specify that the field is at W depth instead of T 135 135 ; depth (automatically activated if vargrid eq 'W') 136 136 ; … … 209 209 IF usetri EQ 1 AND keyword_set(realsection) THEN usetri = 0 210 210 ; did we specify the type ? 211 if keyword_set(typein) then BEGIN 211 if keyword_set(typein) then BEGIN 212 212 if size(type, /type) NE 7 AND size(type, /type) NE 0 then begin 213 213 if n_elements(min) NE 0 then max = min … … 216 216 type = typein 217 217 ENDIF 218 ; 218 ; 219 219 checktypeminmax, 'pltz', TYPE = type, MIN = min, MAX = max $ 220 220 , XZ = xz, YZ = yz, ENDPOINTS = endpoints, _extra = ex 221 221 ; 222 222 if keyword_set(endpoints) then begin 223 section, tab, z2d, glam, gphi, ENDPOINTS = endpoints, TYPE = type $ 223 section, tab, z2d, glam, gphi, ENDPOINTS = endpoints, TYPE = type $ 224 224 , BOXZOOM = boxzoom, DIREC = direc, WDEPTH = wdepth, _extra = ex 225 if z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN 225 if z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN 226 226 restoreboxparam, 'boxparam4pltz.dat' 227 227 return 228 228 ENDIF 229 nx = n_elements(glam) 229 nx = n_elements(glam) 230 230 ny = nx 231 231 if strupcase(vargrid) EQ 'W' then begin … … 240 240 z2d = checkfield(tab, 'pltz', TYPE = type, BOXZOOM = boxzoom $ 241 241 , DIREC = direc, WDEPTH = wdepth, _extra = ex) 242 if z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN 242 if z2d[0] EQ -1 AND n_elements(contour) ne 4 then BEGIN 243 243 restoreboxparam, 'boxparam4pltz.dat' 244 244 return … … 260 260 z2d = reverse(z2d, 2) 261 261 ;----------------------------------------------------------------------------- 262 ; Determination of the mi:min and of the ma:max of z2d in the same way 262 ; Determination of the mi:min and of the ma:max of z2d in the same way 263 263 ; as max: max and min: min for the drawing. 264 264 ;----------------------------------------------------------------------------- … … 316 316 z2d = remplit(z2d, nite = 1-(n_elements(maskfill) NE 0) $ 317 317 , mask = z2d LT valmask/10, /basique, _extra = ex) 318 ENDIF ELSE BEGIN 318 ENDIF ELSE BEGIN 319 319 ; filling the mask values with 8 neighbourg 320 320 z2d = remplit(z2d, nite = (1+(vargrid NE 'T')+keyword_set(nan)) $ 321 321 *(1-(n_elements(maskfill) NE 0)), mask = mask*masknan $ 322 322 , /basique, _extra = ex) 323 ENDELSE 323 ENDELSE 324 324 if keyword_set(strictfill) EQ 0 AND n_elements(maskfill) EQ 0 $ 325 325 then z2d = min > z2d < max … … 329 329 ENDIF 330 330 ;---------------------------------------------------------- 331 ; check the mask and the triangulation according to the grid type and 331 ; check the mask and the triangulation according to the grid type and 332 332 ; nan values. find the coordinates of the mask 333 ;---------------------------------------------------------- 333 ;---------------------------------------------------------- 334 334 ; if (where(mask EQ 0))[0] EQ -1 AND NOT keyword_set(nan) then notri = 1 335 335 ; if keyword_set(notri) then trifield = -1 $ … … 347 347 xmask = xxaxis 348 348 zmask = zzaxis 349 ENDELSE 350 ; 351 if (usetri GE 1 AND (vargrid NE 'T' AND vargrid NE 'W')) THEN BEGIN 349 ENDELSE 350 ; 351 if (usetri GE 1 AND (vargrid NE 'T' AND vargrid NE 'W')) THEN BEGIN 352 352 IF keyword_set(realsection) THEN trimsk = triangule(mask, /basic) $ 353 353 ELSE trimsk = triangule(mask, /basic, coinmonte = coinmontemask $ 354 354 , coindescend = coindescendmask) 355 ENDIF 355 ENDIF 356 356 ;------------------------------------------------------------ 357 357 ; dessin en lui meme … … 387 387 return 388 388 endif 389 if keyword_set(contour) THEN BEGIN 389 if keyword_set(contour) THEN BEGIN 390 390 pourlegende = [1, 1, 1, 1] 391 391 oldattributs = saveatt() … … 403 403 ; 3rd part: drawing of the frame, caption, colorbar... 404 404 ;------------------------------------------------------------ 405 if keyword_set(overplot) then BEGIN 405 if keyword_set(overplot) then BEGIN 406 406 !y.range = [zoom, profmin] ; We get back on physic coordinates 407 407 plot, [0], [0], /nodata, /noerase, title = '', subtitle = '', xstyle = 5, ystyle = 5 … … 409 409 endif 410 410 ;------------------------------------------------------------ 411 ; Caption + d ysplay of them411 ; Caption + display of them 412 412 ;------------------------------------------------------------ 413 413 legende, mi, ma, type, CONTOUR = pourlegende, INTERVALLE = intervalle, DIREC = direc, endpoints = endpoints, _EXTRA = ex … … 423 423 ; Y axis in 1 or 2 part 424 424 ;------------------------------------------------------------ 425 if n_elements(ex) NE 0 then BEGIN 425 if n_elements(ex) NE 0 then BEGIN 426 426 ; To do not put title anymore 427 427 if (where(tag_names(ex) EQ 'TITLE'))[0] NE -1 then ex.TITLE = ' ' … … 429 429 if (where(tag_names(ex) EQ 'SUBTITLE'))[0] NE -1 then ex.SUBTITLE = ' ' 430 430 ; To have just one ytitle 431 if (where(tag_names(ex) EQ 'YTITLE'))[0] NE -1 then BEGIN 431 if (where(tag_names(ex) EQ 'YTITLE'))[0] NE -1 then BEGIN 432 432 ytitle = ex.YTITLE 433 433 ex.YTITLE = ' ' … … 480 480 restoreboxparam, 'boxparam4pltz.dat' 481 481 ; 482 if keyword_set(key_performance) NE 0 THEN print, 'temps pltz', systime(1)-tempsun 482 if keyword_set(key_performance) NE 0 THEN print, 'temps pltz', systime(1)-tempsun 483 483 return 484 484 end -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/scontour.pro
r223 r226 43 43 ; 1) I reinitializate the graphic environment (variables !x, !y et !p): 44 44 if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex 45 ; 2) i put the drawing on the screen like on the post cript45 ; 2) i put the drawing on the screen like on the postscript 46 46 ; if ex contains norease and c_orientation keywords we force ex.noerase = 0 47 47 IF chkstru(ex, 'overplot') EQ 0 THEN placedessin, 'autre', _extra = ex 48 ; fiddle when noerase is used with c_or entation...48 ; fiddle when noerase is used with c_orientation... 49 49 ; call contour with /nodata to get the graphic environment, then force 50 50 ; noerase = 0 and overplot = 1 51 51 IF size(ex, /type) EQ 8 THEN BEGIN 52 ; check if noerase is used with c_or entation52 ; check if noerase is used with c_orientation 53 53 alltags = strlowcase(tag_names(ex)) 54 54 dummy = where(alltags EQ 'noerase', count1) … … 71 71 3:contour, x, y, z, xstyle = 1, ystyle = 1, _EXTRA = ex 72 72 ENDCASE 73 ; fiddle when noerase is used with c_or entation... draw the contour axis73 ; fiddle when noerase is used with c_orientation... draw the contour axis 74 74 IF keyword_set(noerase_orientation) THEN BEGIN 75 75 ex.noerase = 1 -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/splot.pro
r223 r226 47 47 ; 1) I reinitializate the graphic environment (les variables !x, !y et !p): 48 48 if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex 49 ; 2) i put the drawing on the screen like on the post cript49 ; 2) i put the drawing on the screen like on the postscript 50 50 placedessin, 'autre', _extra = ex 51 51 ; 3) Drawing -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/tvplus.pro
r163 r226 7 7 ; Enhanced version of tvscl 8 8 ; 9 ; @categories quick exploration of 2D arrays 10 ; 11 ; INPUTS: 9 ; @categories quick exploration of 2D arrays 12 10 ; 13 11 ; @param Z2D {in}{required} … … 21 19 ; of cellsize that forces tvplus to create a window larger than 22 20 ; the screen, a "scrolling window" will be displayed instead of a 23 ; regular window. Unfortunately the nice function nalities of tvplus21 ; regular window. Unfortunately the nice functionalities of tvplus 24 22 ; are not coded for "scrolling window" case... 25 23 ; … … 33 31 ; The color number that should be used for the mask values. 34 32 ; 35 ; @keyword OFFSET 33 ; @keyword OFFSET 36 34 ; 2 elements vector used by tvplus itself when showing zoom. 37 35 ; It is used to shift the ranges of xaxis and yaxis. 38 ; For example: tvplus,sst[x1:x2,y1:y2],off est=[x1,y1]39 ; 40 ; @keyword MASK 36 ; For example: tvplus,sst[x1:x2,y1:y2],offset=[x1,y1] 37 ; 38 ; @keyword MASK 41 39 ; The mask value. Note that if abs(mask) < 1.e6, then the 42 40 ; exact value of the mask is used to find the maskwd point. … … 67 65 ; @keyword _EXTRA 68 66 ; used to pass keywords to TV, PLOT, COLORBAR 69 ; 70 ; @restrictions 67 ; 68 ; @restrictions 71 69 ; use your mouse to scan the array values... 72 70 ; left button : mouse position and associated array value … … 74 72 ; right button : quit 75 73 ; 76 ; the nice function nalities of tvplus are not coded74 ; the nice functionalities of tvplus are not coded 77 75 ; for "scrolling window" case... 78 76 ; … … 102 100 arr = reform(float(z2d)) 103 101 ;------------------------------------------------------------ 104 ; check the size of the input array 102 ; check the size of the input array 105 103 ;------------------------------------------------------------ 106 104 if (size(arr))[0] NE 2 then begin … … 130 128 ;------------------------------------------------------------ 131 129 ; Compute the size (in pixel) of the square representing 1 132 ; point of the input array 130 ; point of the input array 133 131 ;------------------------------------------------------------ 134 132 dimensions = GET_SCREEN_SIZE() 135 if n_elements(cellsize) EQ 0 then BEGIN 133 if n_elements(cellsize) EQ 0 then BEGIN 136 134 cellsize = min(floor(dimensions/(size(z2d))[1: 2]*.75)) 137 ENDIF ELSE $ 135 ENDIF ELSE $ 138 136 ; we need to use a scrolling bar window 139 137 if cellsize GE min(floor(dimensions/(size(z2d))[1: 2]*.75)) then scrolling = 1 … … 145 143 ; Change the value of the masked value for the min of the non-masked values 146 144 ;------------------------------------------------------------ 147 if n_elements(mask) then BEGIN 148 if abs(mask) LT 1e6 then BEGIN 145 if n_elements(mask) then BEGIN 146 if abs(mask) LT 1e6 then BEGIN 149 147 masked = where(arr EQ mask) 150 148 if masked[0] NE -1 then arr[masked] = min(arr[where(arr NE mask)]) 151 ENDIF ELSE BEGIN 149 ENDIF ELSE BEGIN 152 150 masked = where(abs(arr) GE abs(mask)/10.) 153 151 if masked[0] NE -1 then arr[masked] = min(arr[where(abs(arr) LT abs(mask)/10.)]) … … 157 155 ; apply min/max keywords 158 156 ;------------------------------------------------------------ 159 if n_elements(min) NE 0 then BEGIN 157 if n_elements(min) NE 0 then BEGIN 160 158 arr = min > arr 161 159 truemin = min 162 160 ENDIF ELSE truemin = min(arr) 163 if n_elements(max) NE 0 then BEGIN 161 if n_elements(max) NE 0 then BEGIN 164 162 arr = arr < max 165 163 truemax = max … … 171 169 ENDIF 172 170 ;------------------------------------------------------------ 173 ; apply other keywords (nointerp, c_nan, c_mask) 171 ; apply other keywords (nointerp, c_nan, c_mask) 174 172 ;------------------------------------------------------------ 175 173 if NOT keyword_set(nointerp) then BEGIN … … 177 175 m = 1.*(ncolors-1)/(truemax-truemin) 178 176 p = bottom-1.*truemin*m 179 arr = round(m*temporary(arr)+p) 180 endif 181 ; set c_nan for NaN values 177 arr = round(m*temporary(arr)+p) 178 endif 179 ; set c_nan for NaN values 182 180 if keyword_set(nan) then begin 183 181 if n_elements(c_nan) NE 0 THEN arr[nanindex] = c_nan < (ncolmax -1) $ … … 190 188 arr = byte(temporary(arr)) 191 189 ; increase the size of the array in order to be displayed 192 ; with the suitable size 190 ; with the suitable size 193 191 szarr = size(arr, /dimensions) 194 192 arr = congrid(temporary(arr), szarr[0]*cellsize, szarr[1]*cellsize) … … 205 203 if NOT keyword_set(window) then window = 0 206 204 window, window, xsize = nx+marginpix[0]+marginpix[1] $ 207 , ysize = ny+marginpix[2]+marginpix[3] 205 , ysize = ny+marginpix[2]+marginpix[3] 208 206 ; for 24 bits colors, make sure thate the background color is the good one... 209 207 if !d.n_colors gt 256 then BEGIN … … 215 213 tv, arr, marginpix[0], marginpix[2], _EXTRA = ex 216 214 ; 217 ; axis and plot frame 215 ; axis and plot frame 218 216 ; 219 217 ; get the normalized position of the tv (we just done above) … … 233 231 xenvsauve = !x & yenvsauve = !y & penvsauve = !p 234 232 ; 235 ; draw the colorbar 233 ; draw the colorbar 236 234 ; 237 235 IF truemin ne truemax THEN BEGIN … … 244 242 ENDIF 245 243 ; !p.position = poscadre 246 ENDIF ELSE BEGIN 244 ENDIF ELSE BEGIN 247 245 ;------------------------------------------------------------ 248 246 ; scrolling bar window case... … … 261 259 , yvisible = round(.7*dimensions[1]) < (size(arr))[2], /register, congrid = 0, show_full = 0 262 260 return 263 ENDELSE 261 ENDELSE 264 262 ;------------------------------------------------------------ 265 263 ; Use the mouse to get nice functionalities
Note: See TracChangeset
for help on using the changeset viewer.