Changeset 142 for trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME: 6 ; PLT 7 ; 8 ; PURPOSE: 9 ; trace des graphes horizontaux (cartes) 10 ; 11 ; CATEGORY: 12 ; Graphics, trace des graphes horizontaux 13 ; 14 ; CALLING SEQUENCE: 15 ; plt, champ [,min[, max]] 16 ; 17 ; INPUTS: 18 ; champ: le champ dont on veut faire la carte horizontale champ 19 ; peut etre de 2 types: 5 ; 6 ; @file_comments 7 ; Draw horizontal graph (map) 8 ; 9 ; @categories 10 ; graphic 11 ; 12 ; @param TAB1 {in}{required} 13 ; The field whose we want to make the horizontal map can be 2 kind of thing: 20 14 ; 1) an array. if needed, its mean along the z and t direction 21 15 ; will be automatically performed. 22 ; 2) une structure repondant aux critaire specifies par16 ; 2) a structure respecting all criterions specified by 23 17 ; litchamp.pro. cf. IDL> xhelp,'litchamp' 24 ;25 ; ces ARGUMENTS ne sont pas obligatoires:26 18 ; 27 ; MAX: valeur maximum que l''on veut prendre en compte dans le trace 28 ; des contours. Par defaut on prend le max de tab1 (sur les pts mer) 29 ; 30 ; MIN: valeur minimum que l''on veut prendre en compte dans le trace 31 ; des contours. Par defaut on prend le min de tab1 (sur les pts mer) 32 ; 33 ; KEYWORD PARAMETERS: 34 ; 35 ; BOXZOOM:vecteur indiquant la zone geographique sur laquelle doit etre 36 ; faite la coupe. Si BOXZOOM a : 37 ; 1 element : l''extraction est faite sur [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 38 ; 2 elements: l''extraction est faite sur [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 39 ; 4 elements: l''extraction est faite sur [Boxzoom, 0, max([gdept, gdepw])] 40 ; 5 elements: l''extraction est faite sur [Boxzoom[0:3], 0, Boxzoom[4]] 41 ; 6 elements: l''extraction est faite sur Boxzoom 42 ; 43 ; Ou lon1, lon2,lat1,lat2 sont les variables globales 44 ; definies lors du dernier domdef! 45 ; 46 ; REALCONT:Permet de dessiner les continents definits ds IDL. REALCONT 47 ; peut prendre deux formes: 48 ; /REALCONT: on dessine les continents a la place du mask 49 ; REALCONT=2 on dessine le contours des continents par 50 ; dessus le dessin masque (ceci permet de voir si le masque 51 ; correspond bien aux continents reels). 52 ; 53 ; CB_TITLE: le titre de la colorbar 54 ; 55 ; CB_SUBTITLE: le soustitre de la colorbar 56 ; 57 ; CB_CHARSIZE: The character size of the color bar annotations 58 ; 59 ; CMREF: la longeur en cm sur le papier que doit faire la fleche 60 ; de norme normeref. par defaut ajuste au dessin et compris entre 61 ; .5 et 1.5 cm 62 ; 63 ; COAST_COLOR: the color of the coastline. 64 ; defaut value is 0 => black 65 ; 66 ; COAST_THICK: the thickness of the coastline. 67 ; defaut value is 1 68 ; 69 ; /CONT_NOFILL: activer pour ne pas remplir les points masques 70 ; pour les laisser en transparent! 71 ; Rq: on trace qd meme le contour du mask 72 ; 73 ; CONT_COLOR: the color of the continent. defaut value is 74 ; (!d.n_colors - 1) < 255 => white 75 ; 76 ; CONTINTERVALLE: lorsque CONTOUR est active, valeur d'un 77 ; intervalle entre deux isolignes traces par un trait. Il peut ainsi 78 ; etre different de celui specifie par INTERVALLE 79 ; qui, cas ce cas, ne controle que les isolignes coloriees en 80 ; couleurs. Si aucun min n''est specifie, on choisit un contour min qui va 81 ; bien avec l''intervalle specifie!. Si ce mot cle n''est pas 82 ; specifie, on trace 20 isolignes du min au max. 83 ; 84 ; CONTLABEL: un entier n. lorsque CONTOUR est active, si n 85 ; different de 0, choisit le type de label correspondant aux cas n 86 ; pour les isolignes tracees par un trait. Pour specifier le type de 87 ; label du contour en couleur, utiliser LABEL 88 ; 89 ; CONTMAX: lorsque CONTOUR est active, valeur maximum que l''on 90 ; veut prendre en compte dans le trace des isolignes traces par un 91 ; trait. Par defaut on prend le max (sur les pts mer) 92 ; du tableau passe ds le mot cle CONTOUR. 93 ; 94 ; CONTMIN: lorsque CONTOUR est active, valeur minimum que l''on 95 ; veut prendre en compte dans le trace des isolignes traces par un 96 ; trait. Par defaut on prend le max (sur les pts mer) 97 ; du tableau passe ds le mot cle CONTOUR. 98 ; 99 ; CONTNLEVEL: lorsque CONTOUR est active, nombre de contours 100 ; trace par un trait a dessiner (actif si 101 ; CONTLABEL=0) par defaut =20. 102 ; 103 ; CONTOUR: si on veut tracer les contours d'un champ different que celui 104 ; que l''on dessin en couleur (par ex E-P en couleur et QSR en 105 ; contours). Doit etre un champ repondant aux meme caracteristiques 106 ; que l''argument numero 1 de plt 107 ; 108 ; GRIDTYPE:'U','T','V','W' ou 'F' pour specifer eventuellement la 109 ; grille a laquelle est rattache le champ. Rq: il afaut mieux 110 ; utiliser ds ce cas une structure comme champ 111 ; 112 ; INTERVALLE: valeur d''un intervalle entre deux isolignes. Si 113 ; aucun min n''est specifie, on choisit un contour min qui va bien 114 ; avec l'intervalle specifie!. Si ce mot cle n''est pas specifie, on 115 ; trace 20 isolignes du min au max. Rq: Qd CONTOUR est active 116 ; INTERVALLE ne specifie que intervalle entre 2 isolignes coloriees en 117 ; couleur. Pour specifier l''intervalle entre 2 isolignes traces par un trait 118 ; utiliser CONTINTERVALLE. 119 ; 120 ; /INV: inverse le vecteur couleur utilise pour colorier le graphe 121 ; (sans toucher au noir, au blanc et a la palette utilisee) 19 ; @param PARAM2 {in}{optional}{default=min of tab1 (on ocean points)} 20 ; Min value we want to consider in the contour's drawing. 21 ; Note: Could also be the type of plot that can be only 'xy' for plt 22 ; 23 ; @param PARAM3 {in}{optional}{default=max of tab1 (on ocean points)} 24 ; Max value we want to consider in the contour's drawing. 25 ; Note: if param2 is defined as 'xy' then param3 is used to define the min (see param2) 26 ; 27 ; @param PARAM4 {in}{optional}{default='xy'} 28 ; Type of plot (can be only 'xy' for plt). 29 ; Note: if param2 is defined as 'xy' then param4 is used to define the max (see param3) 30 ; 31 ; @keyword BOXZOOM 32 ; Vector indicating the geographic zone on which we want to cut the map. 33 ; If BOXZOOM has : 34 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 35 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 36 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 37 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 38 ; 6 elements: The extraction is made on Boxzoom 39 ; 40 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 41 ; 42 ; @keyword REALCONT 43 ; Allow to draw continents defined in IDL. REALCONT can have 2 form: 44 ; /REALCONT: we draww continents in place of the mask 45 ; REALCONT=2 we draw cnotinents's contour over the mask (this allows 46 ; to see if the mask correspond at real continents). 47 ; 48 ; @keyword CONTINTERVALLE 49 ; When CONTOUR is activated, it is the value between 2 isolines 50 ; traced by a trait. So it can be different from the one specified by INTERVALLE which, 51 ; in this case, does not control colored isolines in color anymore. If there is noone 52 ; specified min, we choose a contour min which goes well with the specified interval! 53 ; If this keyword is not specified, we trace 20 isolines from the min to the max. 54 ; 55 ; @keyword CONTLABEL 56 ; It is an integer n. When CONTOUR is actvated, if n 57 ; is different of 0, choose the label type corresponding to n cases for 58 ; the traced by a traitisolines. To specify the type of label of the 59 ; colored contour, use LABEL 60 ; 61 ; @keyword CONTMAX 62 ; When CONTOUR is activated, max value we want to consider in the isoline 63 ; traced by a trait's line. By default, we take the max (on ocean points) of the array 64 ; passed in the keyword CONTOUR. 65 ; 66 ; @keyword CONTMIN 67 ; When CONTOUR is activated, min value we want to consider in the isoline 68 ; traced by a trait's line. By default, we take the min (on ocean points) of the array 69 ; passed in the keyword CONTOUR. 70 ; 71 ; @keyword CONTNLEVEL 72 ; When CONTOUR is activated, it is the numbre of contours 73 ; traced by a trait for drawing (active if 74 ; CONTLABEL=0) by default=20. 75 ; 76 ; @keyword CONTOUR 77 ; If we want to trace contours of a different field than the one 78 ; whose we have the colored drawing (by examlpe E-P in color and QSR in contours). 79 ; It must be a field respecting same caracteristics than the argument number one of plt. 80 ; 81 ; @keyword GRIDTYPE 'U','T','V','W' or 'F' to specify possibly the grid on wiche the field is joined. 82 ; Comment: In this case, we should use a structure like field. 83 ; 84 ; @keyword INTERVALLE 85 ; Value of an internal between to isoline. If there is none specified min, 86 ; we choose a min contour which goes well with the specified interval!. If this keyword is not 87 ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, 88 ; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval 89 ; between 2 isolines traced by a trait, use CONTINTERVALLE. 90 ; 91 ; @keyword INV 92 ; Invert the color vector used to color the graph 93 ; (without use the black, the white and the used palette) 122 94 ; 123 ; LABEL: un entier n. si n different de 0, choisit le type de 124 ; label correspondant aux cas n. cf label.pro 125 ; Rq: Qd CONTOUR est active, ne specifie le type de label que pour les 126 ; isolignes coloriees en couleur. Pour celles tracees par un trait 127 ; utiliser CONTLABEL. 128 ; 129 ; /LANDSCAPE: oblige la feuille ou le fenetre a l''ecran a etre 130 ; en position "allongee". 131 ; 132 ; LCT: entier designant le numero de la palette de couleur que 133 ; l''on veut utiliser pour le plot. 95 ; @keyword LABEL 96 ; It is an integer n. If n different of 0, it choose the label's type 97 ; corresponding to cases n. cf label.pro 98 ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. 99 ; For tese one traced by a trait, use CONTLABEL. 134 100 ; 135 ; MAP:Mot cle a actine losque l''on veut faire une projection.136 ; Ce mot cle peut etre de 2 formes:137 ; MAP=[P0lat,P0lon,Rot]. Pour la description de ces 3 valeurs cf.138 ; l''aide en ligne de MAP_SET.139 ; /MAP: dans ce cas map est calcule tout seul et vaut:101 ; @keyword MAP 102 ; We use it when we want to do a projection. 103 ; This keyword can be of two types: 104 ; MAP=[P0lat,P0lon,Rot]. For the descrption of these 3 values (see the online help of MAP_SET). 105 ; /MAP: In this case, map is automatically caculated have the value: 140 106 ; map = [0, (lon1+lon2)/2., 0] 141 ; Rq: Un bon moyen de choisir sa projection est la valeur du vecteur 142 ; MAP est d''utiliser la demo d''IDL5.2: 107 ; Comment: A good way to choose the type of the projection we want to do is to have a look at IDL demo: 143 108 ; IDL> demo 144 ; Puis choisir earth sciences et mapping. 145 ; Rq2: Par defaut c''est une projection cylindrique qui est effectuee 146 ; (avec ou sans le mot cle map). Si on veut une autre projection MAP 147 ; doit etre active et il faut rajouter le mot cle: /nom_projection. 148 ; par ex pour une projection polaire centree sur le pole sud: 109 ; Then choose earth sciences and mapping. 110 ; Comment2: By default it is a cindrical projection which is effectuated (with or without the keyword map). 111 ; If we want an other projection, MAP must be activated and we have to add the keyword: /nom_projection. 112 ; For example, for a polar projection centered on the south pole: 149 113 ; IDL> domdef,-180,180,-90,-45 150 114 ; IDL> plt, tab, /stereo,map=[-90,0,0] 151 115 ; 152 ; labmap: corresponds to label keywords of map_set. Defaut 116 ; @keyword LABMAP 117 ; Corresponds to label keywords of map_set. Defaut 153 118 ; definition is labmap=1 154 119 ; 155 120 ; 156 ; MAXIN: permet de specifier la valeur maximum que l''on veut 157 ; prendre en compte dans le trace des contours a l''aide d''un 158 ; mot cle plutot que par l''argument max. Si l''argument et le 159 ; mot cle sont specifies en meme temps, c''est la valeur 160 ; specifiee par le mot cle qui est retenue. 161 ; 162 ; MININ: permet de specifier la valeur minimum que l''on veut 163 ; prendre en compte dans le trace des contours a l''aide d''un 164 ; mot cle plutot que par l''argument min. Si l''argument et le 165 ; mot cle sont specifies en meme temps, c''est la valeur 166 ; specifiee par le mot cle qui est retenue. 167 ; 168 ; NLEVEL: nombre de contours a dessiner. par defaut =20. actif si 169 ; LABEL=0 ou n'est pas specifie. 170 ; 171 ; /NOCOLORBAR: activer si on ne veut pas de colorbar 172 ; 173 ; /NOCONTOUR: activer si on ne veut pas de contour mais juste 174 ; les couleurs 175 ; 176 ; /NOFILL: activer si on veut juste les contours en noir et 177 ; blanc sur fond blanc 178 ; 179 ; /NOERASE: activer pour faire un dessin a l''ecran sans creer 180 ; une nouvelle fenetre 181 ; 182 ; NORMEREF: la norme de la fleche de reference. par defaut on 183 ; essaie de faire qqch qui colle pas trop mal! 184 ; 185 ; /NOTRI: pour forcer a ne pas utiliser de 186 ; triangulation. Attention dans ce cas le trace ne marchera que 187 ; si la grille est non deformee (cad, chaque pts d''une 188 ; longitude donnee a la meme latitude et chaque pts d''une 189 ; latitude donnee a la meme longitude) sauf si on utilise le mot 190 ; clef CELL_FILL=2. Rq si le champ contient des points a 191 ; !values.f_nan alors on fait qd meme une triangulation. 192 ; 193 ; OVERPLOT: pour faire un plt par dessus un autre. Rq: 194 ; contrairemnet a l''utilisation de CONTOUR ou de VECTEUR, 195 ; l''utilisation de ce mot clef ne modifie pas la legende ou/et 196 ; la barre de couleur. 197 ; 198 ; PETITDESSIN: vecteur de 3 ou 4 elements, applique pour faire un 199 ; dessin sur une petite portion de feuille ou d''ecran. il delimite 200 ; la zone ds laquelle va etre fait le dessin 201 ; si il a 4 elements: 202 ; il est alors constitute des coordonnees -exprime en cm reperes par 203 ; rapport au coin en bas a gauche de la feuille ou de la fenetre 204 ; (en portrait comme en landscape)- du coin en bas a 205 ; gauche et du coin en haut a droite de la zone de dessin. 206 ; si il a 3 elements: 207 ; Ds ce cas, on divise la fenetre ou l''ecran en PETITDESSIN[0] 208 ; colonnes, en PETITDESSIN[1] lignes le dessin se faisant ds la 209 ; case numero PETITDESSIN[2].La numerotation commencant en haut 210 ; a gauche par le numero 1 et suivant apres dans le sens de 211 ; l''ecriture. 212 ; Par defaut on fait un dessin occupant la plus grande place possible 213 ; tout en concervant le rapport d''aspect (sauf qd REMPLI est active) 214 ; 215 ; /PORTRAIT: oblige la feuille ou la fenetre a etre en position "debout". 216 ; 217 ; /POST: faire une sortie postscript. Ne marche que si on fait 218 ; un seul dessin sur la feuille. Si on fait plusieurs dessins, 219 ; utiliser @ps ou plein2dessins 220 ; 221 ; /REMPLI:oblige le dessin a occuper l'espace maximum definit 222 ; par petitdessin 223 ; 224 ; /REVERSE_X: pour inverser l''axe des x (et aussi le dessin) 225 ; 226 ; /REVERSE_Y: pour inverser l''axe des y (et aussi le dessin) 227 ; 228 ; /STRICTFILL: activer ce mot clef pour que le remplissage des 229 ; contours ce fasse precisement entre le min et le max specifie 230 ; en laissant en banc les valeurs inferieurs au min specifie et 231 ; superieurs au max specifie. 232 ; 233 ; STYLE: style de tracer a adopter pour dessiner les isolignes par 234 ; defaut style=0. cf style.pro 235 ; 236 ; UNLABSUR: entier n. specifant qu''on ne labelle qu''un 237 ; contour sur n. Par defaut unlabsur=2 238 ; 239 ; /UNSUR2: si on veut tracer un countour sur deux. par defaut trace 240 ; tous les contours 241 ; 242 ; /UNVECTSUR:un scalaire n on un tableau a 2 elements [n1,n2]. 243 ; dans le premier cas, on tracera un vecteur sur n suivant les 244 ; x et les y. 245 ; dans le second cas on tracera un vecteur sur n1 suivant x 246 ; et un vecteur sur n2 suivant y 247 ; Rq; pour tracer tous les vecteurs suivant y et 1 sur 2 suivant 248 ; x mettre unvectsur=[2,1] 249 ; Rq: ce mot cle est passe ds _extra 250 ; 251 ; VECTCOLOR: la couleur de la fleche. Par defaut noir (couleur 0) 252 ; 253 ; VECTEUR: une structure a 2 elements contenant les 2 champs U 254 ; et V des valeurs de la composante zonale et meridienne du 255 ; champ de vecteurs a tracer. Ces champs peuvent etre un tableau 256 ; ou une structure 257 ; par ex: vecteur={matriceu:lec('unsurface'),matricev:lec('vnsurface')} 258 ; rq:le nom des elements de vecteur n''a aucune importance. 259 ; vecteur={u:lec('unsurface'),v:lec('vnsurface')} convient aussi 260 ; 261 ; VECTMIN=norme minimum des vecteurs a tracer 262 ; 263 ; VECTMAX=norme maximum des vecteurs a tracer 264 ; 265 ; VECTTHICK; l''epaissuer de la fleche. par defaut 1. 266 ; 267 ; WINDOW: numero de la fenetre ou l'on veut faire le graphe (permet 268 ; d'ouvrir plusieurs fenetres). par defaut on ouvre 'IDL0' 269 ; 270 ; YXASPECT: rapport d'echelle entre y et x (par ex: =1 pour un repere 271 ; orthonorme, =2 si l'axe des y est deux fois plus dilate que celui des x). 272 ; Par defaut on adapte pour occupe une grande partie de la feuille en sortie 273 ; postScript ou pour cree une fenetre pas trop etiree 274 ; 275 ; /ZEROMIDDLE: fo force the middle of the colorbar to be equal 276 ; to 0 (force max=max(abs([min,max])) and min=-max) 277 ; 278 ; COMMON BLOCKS: 279 ; common.pro 280 ; 281 ; SIDE EFFECTS: 282 ; 283 ; RESTRICTIONS: 284 ; 285 ; EXAMPLE: 286 ; 287 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 288 ; 7/1999 289 ; Sebastien Masson 08/02/2000 checkfield and 290 ; notri keyword (or triangule = -1) . 121 ; @keyword MAXIN 122 ; Allows to specify the max value we want to consider in the drawing of contour 123 ; helping by the keyword instead of the argument max. If the argument and the keyword are 124 ; specified in the same time, it is the value specified by the keyword which is retained. 125 ; 126 ; @keyword MININ 127 ; Allows to specify the min value we want to consider in the drawing of contour 128 ; helping by the keyword instead of the argument min. If the argument and the keyword are 129 ; specified in the same time, it is the value specified by the keyword which is retained. 130 ; 131 ; @keyword NLEVEL 132 ; Number of contour to draw by default =20. active if 133 ; LABEL=0 or is not specified. 134 ; 135 ; @keyword NOTRI 136 ; To force not to use the triangulation. Beware, in this case, the 137 ; drawing only works if the grid is undeformed (It means that each point of a longitude 138 ; give one latitude and each point of a latitude give one longitude) exept if we use 139 ; the keyword CELL_FILL=2. 140 ; Comment: if the field contain points !values.f_nan, then we even do a triangulation. 141 ; 142 ; @keyword OVERPLOT 143 ; To make a plot over an other one. 144 ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword 145 ; does not the caption and/or the color bar. 146 ; 147 ; @keyword STRICTFILL 148 ; Activate this keyword to that the filling of contours be 149 ; precisely done between the min and the max specified letting values inferior at the 150 ; specified min and values superior at the specified max in white. 151 ; 152 ; @keyword STYLE 153 ; Contour's style to adopt to draw isolines(by default, style=0. see style.pro) 154 ; 155 ; @keyword VECTEUR 156 ; It is a structure composed by 2 elements containing the 2 fields U 157 ; and V of values of the zonal and meridian component of the vector of the fields 158 ; to draw. These fields can be an array or a structure. 159 ; For example: vecteur={matriceu:lec('unsurface'),matricev:lec('vnsurface')} 160 ; Comment: name of elements of vectors are inconsenquential. 161 ; vecteur={u:lec('unsurface'),v:lec('vnsurface')} is also appropriated. 162 ; 163 ; @keyword _EXTRA 164 ; used to pass your keywords 165 ; 166 ; @keyword CONT_NOFILL 167 ; Activate it not to fill the point mask to let them transparent! 168 ; Comment: Nevertheless, we trace mask's contour. 169 ; 170 ; @keyword USETRI 171 ; To force using triangulation. 172 ; 173 ; @keyword MASKFILL 174 ; 175 ; @keyword DUPLICATE 176 ; 177 ; @keyword DECIMATETRI 178 ; 179 ; @uses 180 ; common.pro 181 ; 182 ; @history 183 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 184 ; 7/1999 185 ; Sebastien Masson 08/02/2000 checkfield and 186 ; notri keyword (or triangule = -1) . 187 ; 188 ; @version 189 ; $Id$ 190 ; 191 ; @todo seb 192 ; Changer param "tab1",keyword "REMPLI", "UNLABSUR", "UNSUR2", 193 ; "UNVECTSUR"+ quelques trucs dans la routine. 291 194 ;- 292 195 ;------------------------------------------------------------ 293 196 ;------------------------------------------------------------ 294 197 ;------------------------------------------------------------ 295 pro plt, tab1, giventype, givenmin, givenmax, REALCONT = realcont, CONTOUR = contour $198 pro plt, tab1, param2, param3, param4, REALCONT = realcont, CONTOUR = contour $ 296 199 , INTERVALLE = intervalle, INV = inv, GRIDTYPE = gridtype, BOXZOOM = boxzoom $ 297 200 , CONTINTERVALLE = contintervalle, LABEL = label, CONTLABEL = contlabel $ … … 314 217 ENDIF 315 218 ;-------------------------------------------------------------- 316 tempsun = systime(1) ; pourkey_performance317 ;-------------------------------------------------------------- 318 ;-------------------------------------------------------------- 319 ; I) preparation de l''environnement graphique et petites verifications320 ;-------------------------------------------------------------- 321 ;-------------------------------------------------------------- 322 ; I1) verification du type de grille associe a tab1219 tempsun = systime(1) ; To key_performance 220 ;-------------------------------------------------------------- 221 ;-------------------------------------------------------------- 222 ; I) preparation of the graphic environment and small verifications. 223 ;-------------------------------------------------------------- 224 ;-------------------------------------------------------------- 225 ; I1) verification of the grid's type associated to tab1. 323 226 ;-------------------------------------------------------------- 324 227 if keyword_set(gridtype) then vargrid = gridtype … … 331 234 ENDIF 332 235 ;-------------------------------------------------------------- 333 ; I2) lecture du champ etcheckup.236 ; I2) Reading of the field and checkup. 334 237 ;-------------------------------------------------------------- 335 238 if keyword_set(boxzoom) AND n_elements(contour) ne 4 then BEGIN … … 337 240 saveboxparam, 'boxparam4plt.dat' 338 241 END 339 if n_elements( giventype) NE 0 then type = giventype340 if n_elements( givenmin) NE 0 then min = givenmin341 if n_elements( givenmax) NE 0 then max = givenmax242 if n_elements(param2) NE 0 then type = param2 243 if n_elements(param3) NE 0 then min = param3 244 if n_elements(param4) NE 0 then max = param4 342 245 if n_elements(minin) NE 0 then min = minin 343 246 if n_elements(maxin) NE 0 then max = maxin … … 350 253 IF n_elements(usetri) EQ 0 THEN BEGIN 351 254 ; do we have holes in the triangulation? 352 holeintri = n_elements(triangles_list)/3 LT (jpi-1+keyword_set(key_periodic))*(jpj-1)*2 ; -> the triangulation must be used to draw the data255 holeintri = n_elements(triangles_list)/3 LT (jpi-1+keyword_set(key_periodic))*(jpj-1)*2 ; -> the triangulation must be used to draw the field 353 256 ; do we have a triangulation? 354 257 wehavetri = triangles_list[0] NE -1 ; -> the triangulation must be used to draw the continents … … 366 269 ENDIF 367 270 ;-------------------------------------------------------------- 368 ; I3) reinitiali sation. !p.,!x.,!y.369 ; Rq: on ne reinitialise pas qd on rapelle plt en boucle pour utiliser contour271 ; I3) reinitialization. !p.,!x.,!y. 272 ; Comment: We do not reinitializate when we call bck plt in loop to use contour. 370 273 ;-------------------------------------------------------------- 371 274 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) then reinitplt, /z, /invert 372 275 ;--------------------------------------------------------------- 373 ; I4) attribution du mask et des tableaux de longitude et latitude276 ; I4) attribution of the mask and of longitude and latitude arrays. 374 277 ;--------------------------------------------------------------- 375 278 IF strupcase(vargrid) EQ 'W' THEN profond = firstzw NE 0 $ 376 279 ELSE profond = firstzt NE 0 377 280 ; do we need to extract now the triangulation that will be use for 378 ; contouring the data?281 ; contouring the field? 379 282 if keyword_set(profond) $ 380 283 OR (usetri EQ 0 AND (vargrid EQ 'T' OR vargrid EQ 'W')) $ … … 389 292 ENDELSE 390 293 ;---------------------------------------------------------------------------- 391 ; I5 determination du mi:min et du ma:max de z2d ainsi que de max: max et392 ; min: min pour le dessin.294 ; I5 determination of the mi:min and of the ma:max of z2d in the same way 295 ; as max: max and min: min for the drawing. 393 296 ;----------------------------------------------------------------------------- 394 297 masknan = finite(z2d) 395 298 nan = total(masknan) NE n_elements(z2d) 396 ; faudra-t-il faire un autoscale ???299 ; Do we need to do an autoscale ??? 397 300 autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle) 398 301 determineminmax, z2d, mask, mi, ma, glam, gphi, MININ = min, MAXIN = max $ 399 302 , nan = nan, INTERVALLE = intervalle, usetri = usetri, _extra = ex 400 303 if z2d[0] EQ -1 THEN GOTO, sortie 401 ; on fait un autoscale si besoin304 ; We do an autoscale if needed. 402 305 if autoscale then autoscale, min, max, intervalle 403 306 ;-------------------------------------------------------------- 404 307 ;-------------------------------------------------------------- 405 ; II) mise en place du dessin sur la fenetre ou la page et ouverture406 ; eventuelle de la fenetre et de la page308 ; II) We put the drawing in its place on the window or the page 309 ; and possible opening of the window or of the page. 407 310 ;-------------------------------------------------------------- 408 311 if n_elements(contour) NE 4 AND NOT keyword_set(overplot) THEN $ … … 411 314 ;-------------------------------------------------------------- 412 315 ;-------------------------------------------------------------- 413 ; III) habillage du dessin (labels,style,axe)414 ;------------------------------------------------------------ 415 ;-------------------------------------------------------------- 416 ; 417 ;-------------------------------------------------------------- 418 ; III1) choix deslabels316 ; III) Covering of the drawing (labels,style,axis) 317 ;------------------------------------------------------------ 318 ;-------------------------------------------------------------- 319 ; 320 ;-------------------------------------------------------------- 321 ; III1) Choice of labels 419 322 ;----------------------------------------------------------- 420 323 if keyword_set(intervalle) AND NOT keyword_set(label) then label = 1 … … 423 326 , INTERVALLE = intervalle, strictfill = strictfill 424 327 ;-------------------------------------------------------------- 425 ; III2) choix destyle328 ; III2) Choice of style 426 329 ;----------------------------------------------------------- 427 330 if not keyword_set(style) then style = 0 … … 429 332 if keyword_set(inv) then colnumb = reverse(colnumb) 430 333 ;----------------------------------------------------------- 431 ; III3) definition des axes334 ; III3) Definition of axis 432 335 ;---------------------------------------------------------- 433 336 if NOT keyword_set(overplot) THEN axe, 'xy', _EXTRA = ex … … 435 338 ;-------------------------------------------------------------- 436 339 ;------------------------------------------------------------ 437 ; IV) dessin438 ;-------------------------------------------------------------- 439 ;-------------------------------------------------------------- 440 ;-------------------------------------------------------------- 441 ; extrapolation des donnees sur les terres et seuillage340 ; IV) Drawing 341 ;-------------------------------------------------------------- 342 ;-------------------------------------------------------------- 343 ;-------------------------------------------------------------- 344 ; extrapolation of field on lands and setup of min, max values 442 345 ;-------------------------------------------------------------- 443 346 if keyword_set(nan) then begin … … 464 367 ; nan values. 465 368 ;---------------------------------------------------------- 466 ; si on fait un dessin en profondeur on redefinit une triangulation 467 ; sur le zoom, cette triangulation sera utilisee pour tracer le 468 ; champ. on utilise tmask pour que les trous de cette triangulation 469 ; soient bien les memes que ceux utilises pour tracer le 470 ; masque et correspondent bien au trous qu''il y a a cette nouvelle 471 ; profondeur. 369 ;If we make a drawing in depth, we redifine a triangulation 370 ; on the zoom , this triangulation will be used to trace the 371 ; field. We use tmask in order to holes of this triangulation 372 ; are the same than these used for the mask and correspond to 373 ; holes there is in this new depth. 472 374 if (keyword_set(profond) OR keyword_set(cont_nofill)) $ 473 375 AND ((usetri GE 1 AND (vargrid EQ 'T' OR vargrid EQ 'W')) $ … … 491 393 glammsk = glam 492 394 gphimsk = gphi 493 ENDIF ELSE begin 494 ; decoupe terre: pour que le trace des cotes soit propre on essaye de 495 ; prendre des points en + pour la terre comme ca on ne voit pas le 496 ; decalage des grilles. c''est ce que fait decoupeterre. au passage on 497 ; redefinit trimsk. 395 ENDIF ELSE begin 396 ; decoupe terre: For the drawing of the coast be clean, we try to take additionally 397 ; points for the land. Like that, we do not see grid's gap. It is what decoupeterre 398 ; do. We profit of it to redefine trimsk. 498 399 decoupeterre, mask, glammsk, gphimsk, type = 'xy'$ 499 400 , TRI = trimsk, usetri = usetri, indicezoom = indicezoommask $ … … 502 403 ENDELSE 503 404 ;------------------------------------------------------------ 504 ; IV1) choix du type de dessin405 ; IV1) Choice of type of drawing. 505 406 ;------------------------------------------------------------ 506 407 typetrace = 'classique' 507 408 if keyword_set(map) AND key_onearth then BEGIN 508 ; appelle de mapset qd on veut faire des projections409 ; Call of mapset when we want to do projections. 509 410 IF n_elements(map) NE 3 THEN map = [0, ((lon1+lon2)/2.) MOD 360, 0] 510 411 typetrace = 'projection' … … 526 427 endif 527 428 ENDIF ELSE BEGIN 528 ; pour que les axes de coordonees soient pris en compte429 ;To axes of coordinates be considerated. 529 430 if !x.type EQ 0 AND n_elements(contour) LE 4 then $ 530 431 plot, [0], [0], /nodata, xstyle = 5, ystyle = 5, title = '', subtitle = '', /noerase 531 432 if keyword_set(key_periodic) then BEGIN 532 ; ds ce cas la triangulation est refermee en x et couvre toute la 533 ; sphere. il faut dont la couper au niveau ou l''on coupe la sphere 534 ; pour faire le dessin 433 ; In this case, triangulation is closed in x and cover all the sphere. 434 ; We have to cut it at the level where we cut the sphere to make the drawing. 535 435 if n_elements(trifield) GE 2 then trifield = ciseauxtri(trifield, glam, gphi, _EXTRA = ex) 536 436 if n_elements(trimsk) GE 2 then trimsk = ciseauxtri(trimsk, glammsk, gphimsk, _EXTRA = ex) … … 539 439 endelse 540 440 ;------------------------------------------------------------ 541 ; IV2) coutours et coloriages441 ; IV2) Contours and coloring 542 442 ;------------------------------------------------------------ 543 443 if keyword_set(duplicate) then BEGIN … … 557 457 ; save, glam, gphi, trifield, file = 'tri.dat' 558 458 if keyword_set(decimatetri) then BEGIN 559 tempsdeux = systime(1) ; pourkey_performance459 tempsdeux = systime(1) ; To key_performance 560 460 IF n_elements(trimsk) EQ 0 THEN trimsk = trifield 561 461 Verts = transpose([[(temporary(glam))[*]], [(temporary(gphi))[*]] $ … … 584 484 , masknan = masknan, trinan = trinan, _extra = ex 585 485 ;------------------------------------------------------------ 586 ; IV3) rappelle de plt en boucle qd contour est active486 ; IV3) Recall of plt in loop when contour is activated. 587 487 ;------------------------------------------------------------ 588 488 if n_elements(contour) eq 4 then BEGIN ; c''est la 2eme fois que je passe ds pltt … … 604 504 ;------------------------------------------------------------ 605 505 ;------------------------------------------------------------ 606 ; V) petites finitions607 ;------------------------------------------------------------ 608 ;------------------------------------------------------------ 609 ; 610 ;------------------------------------------------------------ 611 ; V1) ajout eventuel de vecteurs en surimpression506 ; V) Small functions 507 ;------------------------------------------------------------ 508 ;------------------------------------------------------------ 509 ; 510 ;------------------------------------------------------------ 511 ; V1) Possible add of vectors in double exposure. 612 512 ;------------------------------------------------------------ 613 513 if keyword_set(vecteur) then BEGIN … … 619 519 if keyword_set(overplot) then GOTO, fini 620 520 ;------------------------------------------------------------ 621 ; V2) Trace de la ligne de changement de date,l'equateur et 622 ; le meridien de greenwich, ... 521 ; V2) Trace the line of change of date, the equator and the greenwich meridian, ... 623 522 ;------------------------------------------------------------ 624 523 if NOT keyword_set(map) AND key_onearth then meridienparallele, 'xy' 625 524 ;------------------------------------------------------------ 626 ; V3) pour tracer les continents d'IDL525 ; V3) To trace IDL's continents 627 526 ;------------------------------------------------------------ 628 527 if keyword_set(realcont) then BEGIN … … 647 546 ENDIF 648 547 ;------------------------------------------------------------ 649 ; V4) legendes + affichage de celles-ci548 ; V4) caption + display of these. 650 549 ;------------------------------------------------------------ 651 550 legende, mi, ma, 'xy', CONTOUR = pourlegende, VECTLEGENDE = vectlegende, INTERVALLE = intervalle, DIREC = direc, _EXTRA = ex 652 551 if n_elements(ex) NE 0 then BEGIN 653 ; pour garder les axes du cadre en noir552 ; To keep frame's axes in black 654 553 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = coast_color 655 554 endif … … 681 580 endcase 682 581 ;------------------------------------------------------------ 683 ; V5) barre de couleur582 ; V5) Colorbar. 684 583 ;------------------------------------------------------------ 685 584 colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)] … … 688 587 ;------------------------------------------------------------ 689 588 ;------------------------------------------------------------ 690 ; VI) impression eventuelle589 ; VI) Possible print. 691 590 ;------------------------------------------------------------ 692 591 ;------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.