Changeset 226 for trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltbase.pro
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.