Changeset 142 for trunk/SRC/ToBeReviewed/PLOTS/DESSINE
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- Location:
- trunk/SRC/ToBeReviewed/PLOTS/DESSINE
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/bar_plot.pro
r134 r142 1 ; $Id$2 ;3 ; Copyright (c) 1990-2000, Research Systems, Inc. All rights reserved.4 ; Unauthorized reproduction prohibited.5 ;6 1 ;+ 7 ; PURPOSE: 8 ; Create a bar graph, or overplot on an existing one. 9 ; 10 ; CATEGORY: 11 ; Graphics. 12 ; 13 ; CALLING SEQUENCE: 14 ; BAR_PLOT, Values 15 ; 16 ; INPUTS: 17 ; Values: A vector containing the values to be represented by the bars. 18 ; Each element in VALUES corresponds to a single bar in the 19 ; output. 20 ; 21 ; KEYWORD PARAMETERS: 22 ; BASELINES: A vector, the same size as VALUES, that contains the 23 ; base value associated with each bar. If not specified, 24 ; a base value of zero is used for all bars. 25 ; 26 ; COLORS: A vector, the same size as VALUES, containing the color index 27 ; to be used for each bar. If not specified, the colors are 28 ; selected based on spacing the color indices as widely as 29 ; possible within the available colors (specified by D.N_COLORS). 30 ; 31 ; BARNAMES: A string array, containing one string label per bar. 32 ; If the bars are vertical, the labels are placed beneath 33 ; them. If horizontal (rotated) bars are specified, the labels 34 ; are placed to the left of the bars. 35 ; 36 ; TITLE: A string containing the main title to for the bar plot. 37 ; 38 ; XTITLE: A string containing the title for the X axis. 39 ; 40 ; YTITLE: A string containing the title for the Y axis. 41 ; 42 ; BASERANGE: A floating-point scalar in the range 0.0 to 1.0, that 43 ; determines the fraction of the total available plotting area 44 ; (in the direction perpendicular to the bars) to be used. 45 ; If not specified, the full available area is used. 46 ; 47 ; BARWIDTH: A floating-point value that specifies the width of the bars 48 ; in units of "nominal bar width". The nominal bar width is 49 ; computed so that all the bars (and the space between them, 50 ; set by default to 20% of the width of the bars) will fill the 51 ; available space (optionally controlled with the BASERANGE 52 ; keyword). 53 ; 54 ; BARSPACE: A scalar that specifies, in units of "nominal bar width", 55 ; the spacing between bars. For example, if BARSPACE is 1.0, 56 ; then all bars will have one bar-width of space between them. 57 ; If not specified, the bars are spaced apart by 20% of the bar 58 ; width. 59 ; 60 ; BAROFFSET: A scalar that specifies the offset to be applied to the 61 ; first bar, in units of "nominal bar width". This keyword 62 ; allows, for example, different groups of bars to be overplotted 63 ; on the same graph. If not specified, the default offset is 64 ; equal to BARSPACE. 65 ; 66 ; OUTLINE: If set, this keyword specifies that an outline should be 67 ; drawn around each bar. 68 ; 69 ; OVERPLOT: If set, this keyword specifies that the bar plot should be 70 ; overplotted on an existing graph. 71 ; 72 ; BACKGROUND: A scalar that specifies the color index to be used for 73 ; the background color. By default, the normal IDL background 74 ; color is used. 75 ; 76 ; ROTATE: If set, this keyword indicates that horizontal rather than 77 ; vertical bars should be drawn. The bases of horizontal bars 78 ; are on the left, "Y" axis and the bars extend to the right. 79 ; 80 ; OUTPUTS: 81 ; A bar plot is created, or an existing one is overplotted. 82 ; 83 ; EXAMPLE: 84 ; By using the overplotting capability, it is relatively easy to create 2 ; 3 ; @file_comments 4 ; Create a bar graph, or overplot on an existing one. 5 ; 6 ; @categories 7 ; Graphics 8 ; 9 ; @param Values {in}{required} 10 ; A vector containing the values to be represented by the bars. 11 ; Each element in VALUES corresponds to a single bar in the 12 ; output. 13 ; 14 ; @keyword BASELINES 15 ; A vector, the same size as VALUES, that contains the 16 ; base value associated with each bar. If not specified, 17 ; a base value of zero is used for all bars. 18 ; 19 ; @keyword COLORS 20 ; A vector, the same size as VALUES, containing the color index 21 ; to be used for each bar. If not specified, the colors are 22 ; selected based on spacing the color indices as widely as 23 ; possible within the available colors (specified by D.N_COLORS). 24 ; 25 ; @keyword BARNAMES 26 ; A string array, containing one string label per bar. 27 ; If the bars are vertical, the labels are placed beneath 28 ; them. If horizontal (rotated) bars are specified, the labels 29 ; are placed to the left of the bars. 30 ; 31 ; @keyword TITLE 32 ; A string containing the main title to for the bar plot. 33 ; 34 ; @keyword XTITLE 35 ; A string containing the title for the X axis. 36 ; 37 ; @keyword YTITLE 38 ; A string containing the title for the Y axis. 39 ; 40 ; @keyword BASERANGE 41 ; A floating-point scalar in the range 0.0 to 1.0, that 42 ; determines the fraction of the total available plotting area 43 ; (in the direction perpendicular to the bars) to be used. 44 ; If not specified, the full available area is used. 45 ; 46 ; @keyword BARWIDTH 47 ; A floating-point value that specifies the width of the bars 48 ; in units of "nominal bar width". The nominal bar width is 49 ; computed so that all the bars (and the space between them, 50 ; set by default to 20% of the width of the bars) will fill the 51 ; available space (optionally controlled with the BASERANGE 52 ; keyword). 53 ; 54 ; @keyword BARSPACE 55 ; A scalar that specifies, in units of "nominal bar width", 56 ; the spacing between bars. For example, if BARSPACE is 1.0, 57 ; then all bars will have one bar-width of space between them. 58 ; If not specified, the bars are spaced apart by 20% of the bar 59 ; width. 60 ; 61 ; @keyword BAROFFSET 62 ; A scalar that specifies the offset to be applied to the 63 ; first bar, in units of "nominal bar width". This keyword 64 ; allows, for example, different groups of bars to be overplotted 65 ; on the same graph. If not specified, the default offset is 66 ; equal to BARSPACE. 67 ; 68 ; @keyword OUTLINE 69 ; If set, this keyword specifies that an outline should be 70 ; drawn around each bar. 71 ; 72 ; @keyword OVERPLOT 73 ; If set, this keyword specifies that the bar plot should be 74 ; overplotted on an existing graph. 75 ; 76 ; @keyword BACKGROUND 77 ; A scalar that specifies the color index to be used for 78 ; the background color. By default, the normal IDL background 79 ; color is used. 80 ; 81 ; @keyword ROTATE 82 ; If set, this keyword indicates that horizontal rather than 83 ; vertical bars should be drawn. The bases of horizontal bars 84 ; are on the left, "Y" axis and the bars extend to the right. 85 ; 86 ; @examples By using the overplotting capability, it is relatively easy to create 85 87 ; stacked bar charts, or different groups of bars on the same graph. 86 88 ; … … 118 120 ; this could easily be changed.) 119 121 ; 120 ; MODIFICATION HISTORY: 121 ; August 1990, T.J. Armitage, RSI, initial programming. Replacement 122 ; @history August 1990, T.J. Armitage, RSI, initial programming. Replacement 122 123 ; for PLOTBAR and OPLOTBAR routines written by William Thompson. 123 124 ; … … 125 126 ; appearance of the bar plots in the default mode. Included 126 127 ; spacing the bars slightly. 128 ; 129 ; $Id$ 130 ; 127 131 ;- 128 132 pro bar_plot,values,baselines=baselines,colors=colors,barnames=barnames, $ -
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 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt1d.pro
r134 r142 1 1 ;------------------------------------------------------------ 2 2 ;+ 3 ; NAME: 4 ; PLT1D 5 ; 6 ; PURPOSE: 7 ; trace des graphes 1d 8 ; 9 ; CATEGORY: 10 ; Graphics, trace des graphes 1d: x,y,z (ou t mais ds ce cas, on 11 ; rapelle directement pltt) 12 ; 13 ; CALLING SEQUENCE: 14 ; plt1d, champ,type [,min[, max]] 15 ; 16 ; INPUTS: 17 ; champ: le champ dont on veut faire le hovmoller champ 18 ; peut etre de 2 types: 19 ; 1) un tableu qui peut etre: 20 ; * 2d, 3d ou 4d: tableau xy, xyz. xyt ou xyzt. dans ce cas, 21 ; le tableau va passer dans moyenne ou grossemoyenne pour 22 ; etre moyennee et devenir un tableau 1 1d. 23 ; * 1d:type doit qd meme etre specifie pour qu''on sache de 24 ; quel trace il sagit. Pour avoir une legende correcte, 25 ; respecifier la zone d''extraction via BOXZOOM 26 ; 2) une structure repondant aux critaires specifies par 27 ; litchamp.pro. cf. IDL> xhelp,'litchamp'. Le tableau contennu ds 28 ; la structure repondant aux criteres du cas 1) cf. ci-dessus 29 ; 30 ; TYPE: un string: type de plot 1d que l''on veut faire: 31 ; trace suivant: 'x','y','z' 32 ; 33 ; ces arguments ne sont pas obligatoires: 3 ; 4 ; @file_comments 5 ; Trace 1d graphes: x,y,z (or t but in this case, we recall directly pltt) 6 ; 7 ; @categories 8 ; Graphics 9 ; 10 ; @param TAB {in}{required} 11 ; The field whose we want to make the hovmoller map can be 2 kind of thing: 12 ; 1) An array which can be: 13 ; * 2d, 3d or 4d: array xy, xyz. xyt or xyzt. In this case, the array will pass 14 ; in moyenne or grossemoyenne to be averaged and becomme an array 1d. 15 ; * 1d:Nevertheless, the type must be specified in order to we know which trace 16 ; it is about. To have a correct caption, respecify the xctraction zone via BOXZOOM. 17 ; 2) a structure respecting all criterions specified by litchamp.pro. 18 ; See IDL> xhelp,'litchamp'. The array contained in the structure 19 ; respecting criterions of case 1) 20 ; 21 ; @param PARAM2 {in}{required} 22 ; Min value we want to consider in the contour's drawing. 23 ; Note: could also be the type of plot:'x','y','z' 34 24 ; 35 ; MAX: valeur maximum que l'on veut prendre en compte dans le trace 36 ; du plot. Par defaut on prend le max de tableau (sur les pts mer) 37 ; 38 ; MIN: valeur minimum que l'on veut prendre en compte dans le trace 39 ; du plot. Par defaut on prend le min de tableau (sur les pts mer) 40 ; 41 ; KEYWORD PARAMETERS: 42 ; 43 ; BOXZOOM:vecteur indiquant la zone geographique (3d) sur laquelle doit 44 ; etre fait l''extraction du champ pour faire le hovmoeller. 45 ; Si BOXZOOM a : 46 ; 1 element : l''extraction est faite sur [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 47 ; 2 elements: l''extraction est faite sur [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 48 ; 4 elements: l''extraction est faite sur [Boxzoom, vert1, vert2] 49 ; 5 elements: l''extraction est faite sur [Boxzoom[0:3], 0, Boxzoom[4]] 50 ; 6 elements: l''extraction est faite sur Boxzoom 51 ; 52 ; Ou lon1, lon2,lat1,lat2,vert1,vert2 sont les variables globales 53 ; definies lors du dernier domdef! 54 ; 55 ; COL1d: --OBSOLETE--numero de la couleur qd on fait un trace 1d 56 ; par defaut, 0. il faut mieux utiliser le mot cle COLOR utilise 57 ; par plot 58 ; 59 ; ENDPOINTS: mot clef specifiant que l'on veut faire une coupe 60 ; verticale en diagonale. les coordonnees des extremites de 61 ; celle-ci sont alors definies les 4 elements du vecteur 62 ; ENDPOINTS: [x1,y1,x2,y2] qui sont les coordonnees 63 ; 64 ; /LANDSCAPE: oblige la feuille ou le fenetre a l''ecran a etre 65 ; en position "allongee". 66 ; 67 ; MAXIN: permet de specifier la valeur maximum que l''on veut 68 ; prendre en compte dans le trace des contours a l''aide d''un 69 ; mot cle plutot que par l''argument max. Si l''argument et le 70 ; mot cle sont specifies en meme temps, c''est la valeur 71 ; specifiee par le mot cle qui est retenue. 72 ; 73 ; MININ: permet de specifier la valeur minimum que l''on veut 74 ; prendre en compte dans le trace des contours a l''aide d''un 75 ; mot cle plutot que par l''argument min. Si l''argument et le 76 ; mot cle sont specifies en meme temps, c''est la valeur 77 ; specifiee par le mot cle qui est retenue. 78 ; 79 ; /NOERASE: activer pour faire un dessin a l''ecran sans creer 80 ; une nouvelle fenetre. Rq: activer ds le cas d''un Postscript de 81 ; plusieurs traces de type 't' pour ne pas faire un Postscript de 82 ; plusieurs pages 83 ; 84 ; /OV1D:permet de surimprimer un courbe 1d a un precedent trace 1d. 85 ; 86 ; PETITDESSIN: vecteur de 3 ou 4 elements, applique pour faire un 87 ; dessin sur une petite portion de feuille ou d''ecran. il delimite 88 ; la zone ds laquelle va etre fait le dessin 89 ; si il a 4 elements: 90 ; il est alors constitute des coordonnees -exprime en cm reperes par 91 ; rapport au coin en bas a gauche de la feuille ou de la fenetre 92 ; (en portrait comme en landscape)- du coin en bas a 93 ; gauche et du coin en haut a droite de la zone de dessin. 94 ; si il a 3 elements: 95 ; Ds ce cas, on divise la fenetre ou l''ecran en PETITDESSIN[0] 96 ; colonnes, en PETITDESSIN[1] lignes le dessin se faisant ds la 97 ; case numero PETITDESSIN[2].La numerotation commencant en haut 98 ; a gauche par le numero 1 et suivant apres dans le sens de 99 ; l''ecriture. 100 ; Par defaut on fait un dessin occupant la plus grande place possible 101 ; tout en concervant le rapport d''aspect (sauf qd REMPLI est active) 102 ; 103 ; /PORTRAIT: oblige la feuille ou la fenetre a etre en position "debout". 104 ; 105 ; /POST: faire une sortie postscript. Ne marche que si on fait 106 ; un seul dessin sur la feuille. Si on fait plusieurs dessins, 107 ; utiliser @ps ou plein2dessins 108 ; 109 ; /REMPLI:oblige le dessin a occuper l'espace maximum definit 110 ; par petitdessin 111 ; 112 ; /REVERSE_X: pour inverser l''axe des x (et aussi le dessin) 113 ; 114 ; /REVERSE_Y: pour inverser l''axe des y (et aussi le dessin) 115 ; 116 ; /SIN: activer ce mot cle si l''on veut que l'' axe des x soit 117 ; trace en sinus de la latitude qd on fait un frace f(y) 118 ; 119 ; STY1D: --OBSOLETE--numero du style utilise lors d'un trace 120 ; 1d. Il faut mieux utiliser le mot cle LINESTYLE qui est celui 121 ; de plot. Attention ce mot cle est encore utile si on veut 122 ; faire des barres plutot qu'un courbe, mettre sty1d='bar' 123 ; 124 ; /TRANS: fait un postscript (active /post automatiquement) et l'imprime 125 ; -si on le desire- sur un transparant 126 ; 127 ; WINDOW: nimero de la fenetre ou l'on veut faire le graphe (permet 128 ; d'ouvrir plusieurs fenetres). par defaut on ouvre 'IDL0' 129 ; 130 ; YXASPECT: rapport d'echelle entre y et x. Par defaut=1 131 ; Par defaut on adapte pour occupe une grande partie de la feuille en sortie 132 ; postScript ou pour cree une fenetre pas trop etiree 133 ; 134 ; /ZEROMIDDLE: fo force the middle of the colorbar to be equal 135 ; to 0 (force max=max(abs([min,max])) and min=-max) 136 ; 137 ; COMMON BLOCKS: 138 ; common.pro 139 ; 140 ; SIDE EFFECTS: 141 ; 142 ; RESTRICTIONS: 143 ; 144 ; EXAMPLE: 145 ; 146 ; MODIFICATION HISTORY: creation 24/6/99 Eric Guilyardi 147 ; (a partir routine pltt de Sebastien Masson) 25 ; @param PARAM3 {in}{optional}{default=min/max of tab (on ocean points)} 26 ; Max value we want to consider in the contour's drawing. 27 ; Note: if param2 is defined as 'x','y','z' then param3 is used to define the min (see param2) 28 ; 29 ; @param PARAM4 {in}{optional}{default=max of tab (on ocean points)} 30 ; Type of plot (can be only 'x','y','z' for plt1d). 31 ; Note: if param2 is defined as 'xy' then param4 is used to define the max (see param3) 32 ; 33 ; @keyword BOXZOOM 34 ; Vector indicating the geographique zone (3d) on which the extraction of the field must 35 ; be done to do the hovmoeller. 36 ; If BOXZOOM has : 37 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 38 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 39 ; 4 elements: The extraction is made on [Boxzoom, vert1, vert2] 40 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 41 ; 6 elements: The extraction is made on Boxzoom 42 ; 43 ; Where lon1, lon2,lat1,lat2,vert1,vert2 are global variables defined at the last domdef! 44 ; 45 ; @keyword COL1d 46 ; --OBSOLETE--Color number when we make a trace 1d by default, 0.It is better to use the 47 ; keyword COLOR used by plot. 48 ; 49 ; @keyword ENDPOINTS 50 ; keyword specifing that we want to make a vertical cut in diagonal. Then coorinated of extremities 51 ; of these one are difined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 52 ; coordinates. 53 ; 54 ; @keyword MAXIN 55 ; Allows to specify the max value we want to consider in the drawing of contour 56 ; helping by the keyword instead of the argument max. If the argument and the keyword are 57 ; specified in the same time, it is the value specified by the keyword which is retained. 58 ; 59 ; @keyword MININ 60 ; Allows to specify the min value we want to consider in the drawing of contour 61 ; helping by the keyword instead of the argument min. If the argument and the keyword are 62 ; specified in the same time, it is the value specified by the keyword which is retained. 63 ; 64 ; @keyword OV1D 65 ; Allow the double exposure of an 1d curve to a precedent 1d trace. 66 ; 67 ; @keyword REVERSE_X 68 ; To invert the x axis (so as the drawing) 69 ; 70 ; @keyword REVERSE_Y 71 ; To invert the y axis (so as the drawing) 72 ; 73 ; @keyword SIN 74 ; Activate this keyword if we want the x axis to be traced in sinus of the 75 ; latitude when we make a drawing f(y) 76 ; 77 ; @keyword STY1D 78 ; --OBSOLETE-- 79 ; Number of the style used when we make a 1d drawing. We should better use the 80 ; keyword LINESTYLE which is tho one of the plot. Beware, this keyword is still 81 ; useful if we want to d bars instead of curves, put sty1d='bar' 82 ; 83 ; @keyword TYPEIN 84 ; allows to specify the type of hovmoller we want to do 85 ; 'xt','yt','zt','t' 86 ; with help of a keyword rather than the argument type. If the argument andthe 87 ; keyword are specified in the same time, it is the value specified by the 88 ; keyword which is retained. 89 ; 90 ; @keyword _EXTRA 91 ; used to pass your keywords 92 ; 93 ; @history 94 ; creation 24/6/99 Eric Guilyardi 95 ; (a partir routine pltt de Sebastien Masson) 148 96 ; 8/7/1999 Sebastien Masson (smasson@lodyc.jussieu.fr) 149 97 ; inspection des travaux finis 150 98 ; 8/2/2000 Sebastien Masson: checkfield 99 ; 100 ; @version 101 ; $Id$ 102 ; 151 103 ;- 152 104 ;------------------------------------------------------------ 153 105 ;------------------------------------------------------------ 154 106 ;------------------------------------------------------------ 155 pro plt1d, tab, giventype, givenmin, givenmax, BOXZOOM = boxzoom, SIN = sin $107 pro plt1d, tab, param2, param3, param4, BOXZOOM = boxzoom, SIN = sin $ 156 108 , MININ = minin, MAXIN = maxin, TYPEIN = typein, ENDPOINTS = endpoints $ 157 109 , COL1D = col1d, STY1D = sty1d, OV1D = ov1d, X = x, Y = y, Z = z, TT = tt $ … … 172 124 tempsun = systime(1) ; pour key_performance 173 125 ;-------------------------------------------------------------- 174 ; 1 ere partie: initialisation et petits calculs...175 ;-------------------------------------------------------------- 176 ;-------------------------------------------------------------- 177 ;-------------------------------------------------------------- 178 ; verification de la valeur de type179 ;-------------------------------------------------------------- 180 ; 181 if n_elements( giventype) NE 0 then type = giventype182 if n_elements( givenmin) NE 0 then min = givenmin183 if n_elements( givenmax) NE 0 then max = givenmax126 ; 1st part: initialization small calculations... 127 ;-------------------------------------------------------------- 128 ;-------------------------------------------------------------- 129 ;-------------------------------------------------------------- 130 ; verification of the type's value 131 ;-------------------------------------------------------------- 132 ; 133 if n_elements(param2) NE 0 then type = param2 134 if n_elements(param3) NE 0 then min = param3 135 if n_elements(param4) NE 0 then max = param4 184 136 if n_elements(minin) NE 0 then min = minin 185 137 if n_elements(maxin) NE 0 then max = maxin … … 201 153 endif 202 154 ;-------------------------------------------------------------- 203 ; I2) reinitiali sation. !p.,!x.,!y.204 ; Rq: on ne reinitialise pas qd on rapelleplt1d155 ; I2) reinitialization. !p.,!x.,!y. 156 ; Comment: We do not reinitializate when we call back plt1d 205 157 ;-------------------------------------------------------------- 206 158 if NOT keyword_set(ov1d) then reinitplt 207 159 ;-------------------------------------------------------------- 208 ; I1) lecture du champ160 ; I1) Reading of the field 209 161 ;-------------------------------------------------------------- 210 162 if (keyword_set(boxzoom) OR keyword_set(endpoints)) THEN BEGIN … … 233 185 IF keyword_set(savedbox) THEN restoreboxparam, 'boxparam4plt1d.dat' 234 186 return 235 236 ; on construit le mask pour cela le tableau doit etre masque (fait237 ; automatiquement a la valeure valmask si on passe ds moyenne ougrossemoyenne)187 endif 188 ; We build the mask. For this, the array must be hidden (Automaticaly done at valmask 189 ; value if we pass in moyenne or grossemoyenne) 238 190 mask = fltarr(n_elements(z1d)) 239 191 if n_elements(valmask) EQ 0 then valmask = 1e20 … … 246 198 ENDIF ELSE mask[where(z1d LT valmask/10)] = 1 247 199 ;----------------------------------------------------------------------------- 248 ; determination du min et du max apres la moyenne200 ; determination of the min and of the max after the average 249 201 ;----------------------------------------------------------------------------- 250 202 nan = total(finite(z1d, /nan)) < 1 … … 256 208 ;-------------------------------------------------------------- 257 209 ;-------------------------------------------------------------- 258 ; 2 eme partie: dessin259 ;-------------------------------------------------------------- 260 ;----------------------------------------------------------------------------- 261 ; definition des vecteurs abscisse et ordonee262 ; la triangulation est definie pour que le trace soit effectue du bas263 ; a gauche vers le haut a droite. il faut donc la matrice e contourer264 ; se presente de cette maniere, d''ou certains transpose etreverse210 ; 2nd part: Drawing 211 ;-------------------------------------------------------------- 212 ;----------------------------------------------------------------------------- 213 ; definition of the abscisse and ordinate vectors. 214 ; The triangulation is defined in order to the drawing be done from the 215 ; left bottom to the right up. So the matrix have to be shown like this, 216 ; from which some transpose and reverse 265 217 ;----------------------------------------------------------------------------- 266 218 ;----------------------------------------------------------------------------- … … 299 251 ;----------------------------------------------------------- 300 252 ;----------------------------------------------------------- 301 ; definition desaxes253 ; definition of axes 302 254 ;---------------------------------------------------------- 303 255 ; if keyword_set(integrationtps) then axe, type, time[0], time[jpt-1], SIN = sin, _extra = ex $ … … 306 258 ;------------------------------------------------------------ 307 259 ;------------------------------------------------------------ 308 ; d essin260 ; drawing 309 261 ;------------------------------------------------------------ 310 262 ;------------------------------------------------------------ … … 345 297 yy = yy[idx] 346 298 if (not keyword_set(col1d)) then col1d = 0 347 if keyword_set(sty1d) then BEGIN ; si on veut faire des barres299 if keyword_set(sty1d) then BEGIN ;If we want to make bars 348 300 IF strlowcase(strtrim(sty1d)) EQ 'bar' then begin 349 301 !y.range = [!y.range[0]-(!y.range[1]-!y.range[0])*.05, !y.range[1]] … … 352 304 colors = replicate(col1d, n_elements(yy)), /outline 353 305 if n_elements(ex) NE 0 then BEGIN 354 ; pour avoir un cadre de la couleur noire306 ; To have a black frame 355 307 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 356 308 ENDIF … … 364 316 plot, xx, yy, color = col1d, linestyle = sty1d, thick = 2, title = '', subtitle = '', _extra = ex 365 317 if n_elements(ex) NE 0 then BEGIN 366 ; pour avoir un cadre de la couleur 0 et trace une ligne ay=0318 ; To have a 0 colored frame and trace a line at y=0 367 319 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 368 320 if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE = 0 … … 373 325 ((type EQ 'x' AND lat1 NE lat2) OR (type EQ 'y' AND lon1 NE lon2))) $ 374 326 , ystyle = 1, _extra = ex 375 ; ajout d'un axe ds le cas ou l'on utilise endpoints327 ; Add of an axis in the case where we use endpoints 376 328 if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex 377 ; trace une ligne ax=0329 ; Trace a line at x=0 378 330 plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex 379 331 ENDIF ELSE oplot, xx, yy, color = col1d, linestyle = sty1d, thick = 2, _extra = ex 380 332 ;------------------------------------------------------------ 381 333 ;------------------------------------------------------------ 382 ; 3 eme partie: impression eventuelle334 ; 3rd part: Possible print. 383 335 ;------------------------------------------------------------ 384 336 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltbase.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:pltbase 6 ; 7 ; PURPOSE: surcouche de contour pour tracer un champ eventuellement 8 ; masque. brique elementaire de plt, pltz et pltt. 9 ; 10 ; CATEGORY:un tarce vite fait et/ou delestage de l''ecriture de plt, pltz, pltt 11 ; 12 ; CALLING SEQUENCE: pltbase, z2d, x, y, mask,xm, ym, [, levels, colors], 13 ; 14 ; INPUTS: 15 ; z2d:le tableau a tracer 16 ; 17 ; x et y les axes. vecteurs ou tableaux de meme taille que 18 ; z2d. Ce sont les coordonnees de z2d 19 ; 20 ; mask: le tableau qui masque z2d (avec des 0 sur les points a 21 ; masquer et des 1 sur les autres). si z2d n'est pas masque 22 ; mettre cet argument egale a 1. 23 ; 24 ; xm et ym les axes du mask. vecteurs ou tableaux de meme taille que 25 ; mask. Ce sont les coordonnees de mask 26 ; 27 ; levels et colors: (optionnels) les vecteurs qui contiennent 28 ; les niveaus et les couleurs necessaires au contour. S''il ne 29 ; sont pas donnes on prends 20 niveau entre le min et le max. 30 ; 31 ; KEYWORD PARAMETERS: 32 ; 33 ; COLORTRICHAMP : la couleur que l''on veut utiliser pour 34 ; dessiner la triangulation qui est utilisee pour faire les 35 ; contour du champ 36 ; 37 ; COLORTRIMASK : la couleur que l''on veut utiliser pour 38 ; dessiner la triangulation qui est utilisee pour faire les 39 ; contour du mask 40 ; 41 ; COAST_COLOR: the color of the coastline. 42 ; defaut value is 0 => black 43 ; 44 ; COAST_THICK: the thickness of the coastline. 45 ; defaut value is 1 46 ; 47 ; COLOR_C: to draw the contour in color instead of in black 48 ; with filling in color 49 ; 50 ; /CONT_NOFILL: activer pour ne pas remplir les points masques 51 ; pour les laisser en transparent! 52 ; Rq: on trace qd meme le contour du mask 53 ; 54 ; CONT_COLOR: the color of the continent. defaut value is 5 ; 6 ; @file_comments 7 ; Overlayer contour to trace a field which can be mask. 8 ; Elementary brick of plt, pltz et pltt. 9 ; 10 ; @categories graphic 11 ; 12 ; @param Z2D {in}{required} 13 ; The table to trace 14 ; 15 ; @param X {in}{required} 16 ; Axis. Vector or array of the same size that z2d. This is the coordinate of z2d on x. 17 ; 18 ; @param Y {in}{required} 19 ; Axis. Vector or array of the same size that z2d. This is the coordinate of z2d on y. 20 ; 21 ; @param MASK {in}{required} 22 ; It is the array who mask z2d (with 0s on points we want to mask and 1s on others). 23 ; If z2d is not masked, put this argument equal to 1. 24 ; 25 ; @param XM {in}{required} 26 ; Axis of the mask. Vector or array of the same size that mask. 27 ; This is the coordinate of mask on x. 28 ; 29 ; @param YM {in}{required} 30 ; Axis of the mask. Vector or array of the same size that mask. 31 ; This is the coordinate of mask on y. 32 ; 33 ; @param LEVELS {in}{optional} 34 ; Vectors which contain levels needed at the contour. 35 ; If it is not given, we take 20 levels between the min and the max. 36 ; 37 ; @param COLORS {in}{optional} 38 ; Vectors which contain colors needed at the contour. 39 ; If it is not given, we take 20 levels between the min and the max. 40 ; 41 ; @keyword COLORTRICHAMP 42 ; The color we want to use to draw the triangulation which is used to make contours of the field. 43 ; 44 ; @keyword COLORTRIMASK 45 ; The color we want to use to draw the triangulation which is used to make contours of the mask. 46 ; 47 ; @keyword COLOR_C 48 ; To draw the contour in color instead of in black 49 ; with filling in color 50 ; 51 ; @keyword /CONT_NOFILL 52 ; Activate it not to fill the point mask to let them transparent! 53 ; Comment: Nevertheless, we trace mask's contour. 54 ; 55 ; @keyword CONT_COLOR 56 ; The color of the continent. defaut value is 55 57 ; (!d.n_colors - 1) < 255 => white 56 58 ; 57 ; /DESSTRICHAMP: pour dessiner la triangulation qui est 58 ; utilisee pour faire les contour du champ. 59 ; 60 ; /DESSTRIMASK: pour dessiner la triangulation qui est 61 ; utilisee pour faire les contour du mask 62 ; 63 ; /FORPLT: a activer si on veut que le trace des cote soit 64 ; realise par tracecote plutot que tracemask. 65 ; 66 ; I_COLORS: un vecteur specifiant la couleur a utiliser pour 67 ; tracer les contours. C''est la meme chose que c_colors qui 68 ; ajit sur les contours. 69 ; 70 ; MORE: chiffre a donner pour eviter les bug du style: 59 ; @keyword /DESSTRICHAMP 60 ; To draw the triangulation which is used to make field's contours. 61 ; 62 ; @keyword /DESSTRIMASK 63 ; To draw the triangulation which is used to make mask's contours. 64 ; 65 ; @keyword /FORPLT 66 ; To activate if we want that the drawing of coast be realized by tracecote rather than tracemask. 67 ; 68 ; @keyword I_COLORS 69 ; It is a vector specifing the colors to use to trace contours. 70 ; It is the same thing that c_colors which act on contours. 71 ; 72 ; @keyword MORE 73 ; Number to give to avoid style's bugs: 71 74 ; % Out of range subscript encountered: <LONG Array[38911]>. 72 75 ; % Execution halted at: PLTBASE 151 73 ; par defaut more=10 si le bug existe tjs, augmenter la 74 ; valeur de more! (l''explication et la justification de 75 ; cette methode n''ont pas encore de fondements 76 ; scientifiques)... 77 ; 78 ; 79 ; 80 ; /NOFILL: pour faire juste les isolignes 81 ; 82 ; /NOCONTOUR: pour faire juste les couleurs 83 ; 84 ; /UNSUR2: pour tarcer une isoligne sur 2 85 ; 86 ; UNLABSUR: entier n. specifant qu''on ne labelle qu''un 87 ; contour sur n 88 ; 89 ; CONTOUR: pour etrte utilise depuis plt, pltz ou pltt. cf ces 90 ; routines. 91 ; 92 ; _EXTRA: mot cle magique d''idl pour faire passer tous lse 93 ; mots cles acceptes par les routines et fonctions utilises ds 94 ; ce programme sans les declarer explicitement. 95 ; 96 ; OUTPUTS: 97 ; 98 ; COMMON BLOCKS: 99 ; common.pro 100 ; 101 ; SIDE EFFECTS: 102 ; 103 ; RESTRICTIONS:ds le cas ou z2d, x et y sont des tableaux de meme 104 ; taille il faut les metre sous forme de vecteur: z2d[*], x[*], y[*]. 105 ; 106 ; EXAMPLE: 107 ; 108 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 109 ; ???? 110 ; 8/2/2000 check if the tri array is not equal to 111 ; -1. allow contour with out using a triangulation. 76 ; By default more=10 If the bug still exist, increase the value of more! 77 ; (The explanation and the justification of this method do not have scientific bases yet...). 78 ; 79 ; @keyword /NOFILL 80 ; To make just isolines. 81 ; 82 ; @keyword /NOCONTOUR 83 ; To make just colors. 84 ; 85 ; @keyword /UNSUR2 To trace one isoline on two. 86 ; 87 ; @keyword UNLABSUR 88 ; Is an integer n. specifying we only label one contour on two 89 ; 90 ; @keyword CONTOUR 91 ; To be used since plt, pltz or pltt. (Have a look on these routines). 92 ; 93 ; @keyword _EXTRA 94 ; Used to pass your keywords 95 ; 96 ; @uses 97 ; common.pro 98 ; 99 ; @restrictions 100 ; In the case of z2d, x and y are arrays of same size, we hate to put them as vectors: z2d[*], x[*], y[*]. 101 ; 102 ; @history 103 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 104 ; ???? 105 ; 8/2/2000 check if the tri array is not equal to 106 ; -1. allow contour with out using a triangulation. 107 ; 108 ; @version 109 ; $Id$ 110 ; 111 ; @todo seb L.172 à 173 112 112 ; 113 113 ;- … … 145 145 ;--------------------------------------------------------- 146 146 ; 147 ; explication concernant contour. Ce mot cle est active qd on on trace148 ; un contour en couleur different de celui en trait noir.149 ; si il est active (cas n_elements(contour) NE 0), on passe 2 fois dspltbase:150 ; 1) on trace les couleurs puis on sort c''est le cas:147 ; Explanation concerning contour. This keyword is activated when we trace a 148 ; colored contour different from the one with black trait. 149 ; If it is activated (case n_elements(contour) NE 0), we pass 2 time in pltbase: 150 ; 1) We trace colors then we leave, it is the case: 151 151 ; n_elements(contour) NE 0 AND n_elements(contour) NE 4) 152 ; 2) on trace les contour en trait puis les continents c''est le cas152 ; 2) We trace contours in traits then continents, it is the case: 153 153 ; n_elements(contour) NE 0 AND n_elements(contour) EQ 4) 154 154 ; 155 155 ;------------------------------------------------------------ 156 tempsun = systime(1) ; pourkey_performance156 tempsun = systime(1) ; To key_performance 157 157 if n_elements(mask) EQ 0 then mask = 1b 158 158 if n_elements(masknan) EQ 0 then masknan = 1b 159 159 IF total(mask) EQ n_elements(z2d) THEN mask = 1b 160 160 ;---------------------------------------------------------------------- 161 ; si les niveaux et les couleurs ne sont pas donnes161 ; If levels and colors aren't given 162 162 ;---------------------------------------------------------------------- 163 163 if n_params() EQ 4 then $ … … 168 168 plot, [0], [0], xstyle = 5, ystyle = 5, /nodata, /noerase, title = '', subtitle = '' 169 169 ;---------------------------------------------------------------------- 170 ; si cell_fill fait partit de _extra, on le desactive si il n''est pas 171 ; egale a 2 170 ; Is cell_fill is a part of _extra, we desactive it if it is nt equal to 2 172 171 ;---------------------------------------------------------------------- 173 172 IF chkstru(ex, 'CELL_FILL') THEN BEGIN … … 176 175 ENDIF ELSE cell_fill = 0 ; 177 176 ;---------------------------------------------------------------------- 178 ; I) remplissage des contours en palette de couleur177 ; I) Filling of contours in palette colors 179 178 ;---------------------------------------------------------------------- 180 179 if NOT keyword_set(more) then more = 10 … … 200 199 IF chkstru(ex, 'C_COLORS') THEN ex = extractstru(ex, 'C_COLORS') 201 200 ;------------------------------------------------------------ 202 ; II) trace des contours en trait201 ; II) Drawing of contours in traits 203 202 ;------------------------------------------------------------ 204 203 if n_elements(contour) EQ 4 OR n_elements(contour) EQ 0 THEN BEGIN … … 215 214 ENDIF 216 215 ; 217 ; on ne passe pas si on doit faire des contours differents...218 ; ds le cas on unsur2 est active on reduitlevels216 ; We do not pass if we have to make differents contours... 217 ; In the case of unsur2 is activated, we reduce levels 219 218 if NOT keyword_set(nocontour) then begin 220 219 IF keyword_set(unsur2) THEN levels = levels[where(zeroun(n_elements(levels) ) eq 1)] 221 ; unlabsur est active? C_LABEL est passevia _EXTRA?220 ; Is unlabsur activated? Does C_LABEL passed via _EXTRA? 222 221 if keyword_set(unlabsur) THEN IF chkstru(ex, 'C_LABELS') THEN $ 223 222 ex.C_LABELS = 1-((indgen(n_elements(ex.C_LABELS)) MOD unlabsur) < 1) 224 223 ; 225 ; pour ne pas filler qd cell_fill est impose...224 ; Not to fill when cell_fill is imposed... 226 225 IF chkstru(ex, 'CELL_FILL') THEN ex.CELL_FILL = 0 227 226 ; … … 248 247 ENDIF 249 248 ;---------------------------------------------------------------------- 250 ; III) remplissage des continents de couleur249 ; III) Filling of colored continents. 251 250 ;---------------------------------------------------------------------- 252 251 IF chkstru(ex, 'CELL_FILL') THEN ex.CELL_FILL = cell_fill < 1 … … 255 254 IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) < 255 256 255 ; 257 ; si il y a des points a nan 258 ; on trace en blanc les points a nan avant de dessiner les cotes avec 259 ; un trait. 256 ; If there is points at NaN 257 ; We trace points in white at NaN bafore drawing coasts with a trait. 260 258 ; 261 259 if keyword_set(trinan) THEN BEGIN … … 273 271 ENDIF 274 272 ; 275 ; remplissage descontinents273 ; Filling of continents 276 274 ; 277 275 if keyword_set(realcont) then if realcont EQ 1 then mask = 1b 278 if n_elements(mask) NE 1 then BEGIN ; si mask=1 on saute.276 if n_elements(mask) NE 1 then BEGIN ; If mask=1 we gap it. 279 277 ; 280 278 if NOT keyword_set(cont_nofill) then BEGIN … … 308 306 ENDIF ; NOT keyword_set(cont_nofill) 309 307 ;------------------------------------------------------------ 310 ; IV) trace les cotes en trait308 ; IV) Trace coast in traits 311 309 ;------------------------------------------------------------ 312 310 case 1 of -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltsc.pro
r134 r142 1 ;+ 2 ; 3 ; @todo seb 4 ; 5 ;- 1 6 PRO pltsc,tab1,tab2, min1, max1, min2, max2, varname2, BOXZOOM = boxzoom, $ 2 7 COL1D=col1d,STY1D=sty1d,OV1D=ov1d, _extra = ex … … 18 23 ;-------------------------------------------------------------- 19 24 20 ; Rq: on ne reinitialise pas qd on rapellepltsc25 ; Comment: We do not reinitializate when we call back pltsc 21 26 if NOT keyword_set(ov1d) then reinitplt 22 27 ;; reduce data xyzt domain … … 74 79 75 80 if n_elements(ex) NE 0 then BEGIN 76 ; pour avoir un cadre de la couleur 0 et trace une ligne ay=081 ; To have a 0 colored frame and trace a line at y=0 77 82 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 78 83 if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE= 0 79 84 ENDIF 80 85 plot, !x.range, [0, 0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex 81 ; trace une ligne ax=086 ; trace a line at x=0 82 87 plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex 83 88 ENDIF ELSE oplot,xx,yy,color=col1d,linestyle=sty1d,thick=2, _extra = ex 84 89 ;------------------------------------------------------------ 85 90 ;------------------------------------------------------------ 86 ; 3 eme partie: impression eventuelle91 ; 3rd part: Possible print 87 92 ;------------------------------------------------------------ 88 93 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro
r134 r142 1 1 ;------------------------------------------------------------ 2 2 ;+ 3 ; NAME: 4 ; PLTT 5 ; 6 ; PURPOSE: 7 ; trace des graphes hovmoller 8 ; 9 ; CATEGORY: 10 ; Graphics, trace des graphes hovmoller: xt,yt,zt,t 11 ; 12 ; CALLING SEQUENCE: 13 ; pltt, champ,type [,min[, max[, datmin[, datmax]]]] 14 ; 15 ; INPUTS: 16 ; champ: le champ dont on veut faire le hovmoller champ 17 ; peut etre de 2 types: 18 ; 1) un tableu qui peut etre: 19 ; * 3d ou 4d: la derniere composante etant le temps. dans ce 20 ; cas, le tableau va passer dans grossemoyenne pour etre 21 ; moyennee suivant et devenir un tableau 2d ou 1d. 22 ; * 2d: si tableau est deja 2d, il n''est pas modifie 23 ; (attention les terres doivent etre masquees a la valeure 24 ; valmask) et type doit qd meme etre specifie pour qu''on 25 ; sache de quel trace il sagit. Pour avoir une legende 26 ; correcte, respecifier la zone d''extraction via BOXZOOM 27 ; * 1d: uniquement pour les traces de type 't'. Type doit qd 28 ; meme etre specifie pour qu''on sache de quel trace il 29 ; sagit. Pour avoir une legende correcte, respecifier la zone 30 ; d''extraction via BOXZOOM 31 ; 2) une structure repondant aux critaire specifies par 32 ; litchamp.pro. cf. IDL> xhelp,'litchamp'. Le tableau contennu ds 33 ; la structure repondant aux criteres du cas 1) cf. ci-dessus 34 ; 35 ; TYPE: type de hovmoller que l''on veut faire: 36 ; 'xt','yt','zt','t' 37 ; 38 ; ces arguments ne sont pas obligatoires: 3 ; 4 ; @file_comments 5 ; Trace hovmoller graphs: xt,yt,zt,t 6 ; 7 ; @categories Graphics 8 ; 9 ; @param TAB {in}{required} 10 ; The field whose we want to make the hovmoller map can be 2 kind of thing: 11 ; 1) An array which can be: 12 ; * 3d or 4d: array 'xt','yt','zt','t'. The last component is the time. In this case, the array will 13 ; pass in grossemoyenne to be averaged and become an 1d or 2d array. 14 ; * 2d: If the array is already 2d, it is not modified (beware, lands must 15 ; be masked at the value valmask) and nevertheless,type must be specified 16 ; to we know of which trace it is about. 17 ; To have a correct caption, respecify the xctraction zone via BOXZOOM. 18 ; * 1d: only for traces of the 't' type. Nevertheless, type must be specified 19 ; to we know of which trace it is about. 20 ; To have a correct caption, respecify the xctraction zone via BOXZOOM. 21 ; 2) a structure respecting all criterions specified by litchamp.pro. 22 ; See IDL> xhelp,'litchamp'. The array contained in the structure 23 ; respecting criterions of case 1) 39 24 ; 40 ; MAX: valeur maximum que l''on veut prendre en compte dans le trace 25 ; PARAM: 26 ; MAX: valeur maximum que l''on veut prendre en compte dans le trace 41 27 ; des contours. Par defaut on prend le max de tableau (sur les pts mer) 42 28 ; … … 51 37 ; longinteger de la forme yyyymmdd (ou bien yymmdd) 52 38 ; 53 ; KEYWORD PARAMETERS: 54 ; 55 ; BOXZOOM:vecteur indiquant la zone geographique (3d) sur laquelle doit 56 ; etre fait l''extraction du champ pour faire le hovmoeller. 57 ; Si BOXZOOM a : 58 ; 1 element : l''extraction est faite sur [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 59 ; 2 elements: l''extraction est faite sur [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 60 ; 4 elements: l''extraction est faite sur [Boxzoom, vert1, vert2] 61 ; 5 elements: l''extraction est faite sur [Boxzoom[0:3], 0, Boxzoom[4]] 62 ; 6 elements: l''extraction est faite sur Boxzoom 63 ; 64 ; Ou lon1, lon2,lat1,lat2,vert1,vert2 sont les variables globales 65 ; definies lors du dernier domdef! 66 ; 67 ; CB_TITLE: le titre de la colorbar 68 ; 69 ; CB_SUBTITLE: le soustitre de la colorbar 70 ; 71 ; CB_CHARSIZE: The character size of the color bar annotations 72 ; 73 ; COAST_COLOR: the color of the coastline. 74 ; defaut value is 0 => black 75 ; 76 ; COAST_THICK: the thickness of the coastline. 77 ; defaut value is 1 78 ; 79 ; /CONT_NOFILL: activer pour ne pas remplir les points masques 80 ; pour les laisser en transparent! 81 ; Rq: on trace qd meme le contour du mask 82 ; 83 ; CONT_COLOR: the color of the continent. defaut value is 84 ; (!d.n_colors - 1) < 255 => white 85 ; 86 ; CONTINTERVALLE: lorsque CONTOUR est active, valeur d''un 87 ; intervalle entre deux isolignes traces par un trait. Il peut ainsi 88 ; etre different de celui specifie par INTERVALLE 89 ; qui, cas ce cas, ne controle que les isolignes coloriees en 90 ; couleurs. Si aucun min n''est specifie, on choisit un contour min qui va 91 ; bien avec l''intervalle specifie!. Si ce mot cle n''est pas 92 ; specifie, on trace 20 isolignes du min au max. 93 ; 94 ; CONTLABEL: un entier n. lorsque CONTOUR est active, si n 95 ; different de 0, choisit le type de label correspondant aux cas n 96 ; pour les isolignes tracees par un trait. Pour specifier le type de 97 ; label du contour en couleur, utiliser LABEL 98 ; 99 ; CONTMAX: lorsque CONTOUR est active, valeur maximum que l''on 100 ; veut prendre en compte dans le trace des isolignes traces par un 101 ; trait. Par defaut on prend le max (sur les pts mer) 102 ; du tableau passe ds le mot cle CONTOUR. 103 ; 104 ; CONTMIN: lorsque CONTOUR est active, valeur minimum que l''on 105 ; veut prendre en compte dans le trace des isolignes traces par un 106 ; trait. Par defaut on prend le max (sur les pts mer) 107 ; du tableau passe ds le mot cle CONTOUR. 108 ; 109 ; CONTNLEVEL: lorsque CONTOUR est active, nombre de contours 110 ; trace par un trait a dessiner (actif si 111 ; CONTLABEL=0) par defaut =20. 112 ; 113 ; CONTOUR: si on veut tracer les contours d''un champ different que celui 114 ; que l''on dessin en couleur (par ex E-P en couleur et QSR en 115 ; contours). Doit etre un champ reponadnt aux meme caracteristiques 116 ; que l''argument numero 1 de pltt 117 ; 118 ; ENDPOINTS: mot clef specifiant que l'on veut faire une coupe 119 ; verticale en diagonale. les coordonnees des extremites de 120 ; celle-ci sont alors definies les 4 elements du vecteur 121 ; ENDPOINTS: [x1,y1,x2,y2] qui sont les coordonnees 122 ; 123 ; /EXCHANGE_XY: permet d''intervertir les axes. 39 ; @keyword BOXZOOM 40 ; Vector indicating the geographique zone (3d) on which the extraction of the field must 41 ; be done to do the hovmoeller. 42 ; If BOXZOOM has : 43 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 44 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 45 ; 4 elements: The extraction is made on [Boxzoom, vert1, vert2] 46 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 47 ; 6 elements: The extraction is made on Boxzoom 48 ; 49 ; Where lon1, lon2,lat1,lat2,vert1,vert2 are global variables defined at the last domdef! 50 ; 51 ; @keyword CONTINTERVALLE 52 ; When CONTOUR is activated, it is the value between 2 isolines 53 ; traced by a trait. So it can be different from the one specified by INTERVALLE which, 54 ; in this case, does not control colored isolines in color anymore. If there is noone 55 ; specified min, we choose a contour min which goes well with the specified interval! 56 ; If this keyword is not specified, we trace 20 isolines from the min to the max. 57 ; 58 ; @keyword CONTLABEL 59 ; It is an integer n. When CONTOUR is actvated, if n 60 ; is different of 0, choose the label type corresponding to n cases for 61 ; the traced by a traitisolines. To specify the type of label of the 62 ; colored contour, use LABEL 63 ; 64 ; @keyword CONTMAX 65 ; When CONTOUR is activated, max value we want to consider in the isoline 66 ; traced by a trait's line. By default, we take the max (on ocean points) of the array 67 ; passed in the keyword CONTOUR. 68 ; 69 ; @keyword CONTMIN 70 ; When CONTOUR is activated, min value we want to consider in the isoline 71 ; traced by a trait's line. By default, we take the min (on ocean points) of the array 72 ; passed in the keyword CONTOUR. 73 ; 74 ; @keyword CONTNLEVEL 75 ; When CONTOUR is activated, it is the numbre of contours 76 ; traced by a trait for drawing (active if 77 ; CONTLABEL=0) by default=20. 78 ; 79 ; @keyword CONTOUR 80 ; If we want to trace contours of a different field than the one 81 ; whose we have the colored drawing (by examlpe E-P in color and QSR in contours). 82 ; It must be a field respecting same caracteristics than the argument number one of pltt. 83 ; 84 ; @keyword ENDPOINTS 85 ; keyword specifing that we want to make a vertical cut in diagonal. Then coorinated of extremities 86 ; of these one are difined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 87 ; coordinates. 88 ; 89 ; @keyword EXCHANGE_XY 90 ; Allows to invert axes. 124 91 ; 125 ; FILTER: applique une moyenne glissante de largeur FILTER 92 ; @keyword FILTER 93 ; Apply a slippery average of width FILTER 126 94 ; 127 ; INTERVALLE: valeur d''un intervalle entre deux isolignes. Si128 ; aucun min n''est specifie, on choisit un contour min qui va bien129 ; avec l''intervalle specifie!. Si ce mot cle n''est pas specifie, on130 ; trace 20 isolignes du min au max. Rq: Qd CONTOUR est active131 ; INTERVALLE ne specifie que intervalle entre 2 isolignes coloriees en132 ; couleur. Pour specifier l''intervalle entre 2 isolignes traces par un trait133 ; utiliser CONTINTERVALLE.134 ; 135 ; /INV: inverse le vecteur couleur utilise pour colorier le graphe136 ; (sans toucher au noir, au blanc et a la palette utilisee)95 ; @keyword INTERVALLE 96 ; Value of an internal between to isoline. If there is none specified min, 97 ; we choose a min contour which goes well with the specified interval!. If this keyword is not 98 ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, 99 ; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval 100 ; between 2 isolines traced by a trait, use CONTINTERVALLE. 101 ; 102 ; @keyword INV 103 ; Invert the color vector used to color the graph 104 ; (without use the black, the white and the used palette) 137 105 ; 138 ; LABEL: un entier n. si n different de 0, choisit le type de 139 ; label correspondant aux cas n. cf label.pro 140 ; Rq: Qd CONTOUR est active, ne specifie le type de label que pour les 141 ; isolignes coloriees en couleur. Pour celles tracees par un trait 142 ; utiliser CONTLABEL. 143 ; 144 ; /LANDSCAPE: oblige la feuille ou le fenetre a l''ecran a etre 145 ; en position "allongee". 146 ; 147 ; LCT: entier designant le numero de la palette de couleur que 148 ; l''on veut utiliser pour le plot. 149 ; 150 ; COL1d: --OBSOLETE--numero de la couleur qd on fait un trace 1d 151 ; par defaut, 0. il faut mieux utiliser le mot cle COLOR utilise 152 ; par plot 153 ; 154 ; MAXIN: permet de specifier la valeur maximum que l''on veut 155 ; prendre en compte dans le trace des contours a l''aide d''un 156 ; mot cle plutot que par l''argument max. Si l''argument et le 157 ; mot cle sont specifies en meme temps, c''est la valeur 158 ; specifiee par le mot cle qui est retenue. 159 ; 160 ; MININ: permet de specifier la valeur minimum que l''on veut 161 ; prendre en compte dans le trace des contours a l''aide d''un 162 ; mot cle plutot que par l''argument min. Si l''argument et le 163 ; mot cle sont specifies en meme temps, c''est la valeur 164 ; specifiee par le mot cle qui est retenue. 165 ; 166 ; NLEVEL: nombre de contours a dessiner. par defaut =20. actif si 167 ; LABEL=0 ou n''est pas specifie. 168 ; 169 ; CONTNLEVEL: nombre de contours a dessiner qd on utilise ajoutcontour 170 ; active par le mot cle CONTOUR.(actif si CONTLABEL=0) par defaut =20. 171 ; 172 ; /NOCOLORBAR: activer si on ne veut pas de colorbar 173 ; 174 ; /NOCONTOUR: activer si on ne veut pas de contour mais juste 175 ; les couleurs 176 ; 177 ; /NOFILL: activer si on veut juste les contours en noir et 178 ; blanc sur fond blanc 179 ; 180 ; /NOERASE: activer pour faire un dessin a l''ecran sans creer 181 ; une nouvelle fenetre. Rq: activer ds le cas d''un Postscript de 182 ; plusieurs traces de type 't' pour ne pas faire un Postscript de 183 ; plusieurs pages 184 ; 185 ; /OV1D:permet de surimprimer un courbe 1d a un precedent trace 1d. 186 ; 187 ; OVERPLOT: pour faire un pltt par dessus un autre. Rq: 188 ; contrairemnet a l''utilisation de CONTOUR, 189 ; l''utilisation de ce mot clef ne modifie pas la legende ou/et 190 ; la barre de couleur. dans le cas d''un plot 1d, contrairement 191 ; a ov1d, on peut changer les axes et les ranges. 192 ; 193 ; PETITDESSIN: vecteur de 3 ou 4 elements, applique pour faire un 194 ; dessin sur une petite portion de feuille ou d''ecran. il delimite 195 ; la zone ds laquelle va etre fait le dessin 196 ; si il a 4 elements: 197 ; il est alors constitute des coordonnees -exprime en cm reperes par 198 ; rapport au coin en bas a gauche de la feuille ou de la fenetre 199 ; (en portrait comme en landscape)- du coin en bas a 200 ; gauche et du coin en haut a droite de la zone de dessin. 201 ; si il a 3 elements: 202 ; Ds ce cas, on divise la fenetre ou l''ecran en PETITDESSIN[0] 203 ; colonnes, en PETITDESSIN[1] lignes le dessin se faisant ds la 204 ; case numero PETITDESSIN[2].La numerotation commencant en haut 205 ; a gauche par le numero 1 et suivant apres dans le sens de 206 ; l''ecriture. 207 ; Par defaut on fait un dessin occupant la plus grande place possible 208 ; tout en concervant le rapport d''aspect (sauf qd REMPLI est active) 209 ; 210 ; /PORTRAIT: oblige la feuille ou la fenetre a etre en position "debout". 211 ; 212 ; /POST: faire une sortie postscript. Ne marche que si on fait 213 ; un seul dessin sur la feuille. Si on fait plusieurs dessins, 214 ; utiliser @ps ou plein2dessins 215 ; 216 ; REPEAT_C=n pour repeter une serie temporelle n fois 217 ; 218 ; /REMPLI:oblige le dessin a occuper l''espace maximum definit 219 ; par petitdessin 220 ; 221 ; /REVERSE_X: pour inverser l''axe des x (et aussi le dessin) 222 ; 223 ; /REVERSE_Y: pour inverser l''axe des y (et aussi le dessin) 224 ; 225 ; /STRICTFILL: activer ce mot clef pour que le remplissage des 226 ; contours ce fasse precisement entre le min et le max specifie 227 ; en laissant en banc les valeurs inferieurs au min specifie et 228 ; superieurs au max specifie. 229 ; 230 ; STYLE: style de tracer a adopter pour dessiner les isolignes par 231 ; defaut style=0. cf style.pro 232 ; 233 ; STY1D: --OBSOLETE--numero du style utilise lors d''un trace 234 ; 1d. Il faut mieux utiliser le mot cle LINESTYLE qui est celui 235 ; de plot. Attention ce mot cle est encore utile si on veut 236 ; faire des barres plutot qu''une courbe, mettre sty1d='bar' 237 ; 238 ; /TRANS: fait un postscript (active /post automatiquement) et l''imprime 239 ; -si on le desire- sur un transparant 240 ; 241 ; TREND_TYPE: modify data by calling trends.pro 242 ; 243 ; TYPEIN: permet de specifier la valeur type de hovmoller que 244 ; l''on veut faire: 106 ; @keyword LABEL 107 ; It is an integer n. If n different of 0, it choose the label's type 108 ; corresponding to cases n. cf label.pro 109 ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. 110 ; For tese one traced by a trait, use CONTLABEL. 111 ; 112 ; @keyword COL1d 113 ; --OBSOLETE--Color number when we make a trace 1d by default, 0.It is better to use the 114 ; keyword COLOR used by plot. 115 ; 116 ; @keyword MAXIN 117 ; Allows to specify the max value we want to consider in the drawing of contour 118 ; helping by the keyword instead of the argument max. If the argument and the keyword are 119 ; specified in the same time, it is the value specified by the keyword which is retained. 120 ; 121 ; @keyword MININ 122 ; Allows to specify the min value we want to consider in the drawing of contour 123 ; helping by the keyword instead of the argument min. 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 NLEVEL 127 ; Number of contour to draw by default =20. active if 128 ; LABEL=0 or is not specified. 129 ; 130 ; @keyword CONTNLEVEL 131 ; When CONTOUR is activated, it is the numbre of contours 132 ; traced by a trait for drawing (active if 133 ; CONTLABEL=0) by default=20. 134 ; 135 ; @keyword OV1D 136 ; Allows to overprint a 1d curve over a precedent 1d drawing. 137 ; 138 ; @keyword OVERPLOT 139 ; To make a plot over an other one. 140 ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword 141 ; does not the caption and/or the color bar. 142 ; 143 ; @keyword STRICTFILL 144 ; Activate this keyword to that the filling of contours be 145 ; precisely done between the min and the max specified letting values inferior at the 146 ; specified min and values superior at the specified max in white. 147 ; 148 ; @keyword STYLE 149 ; Contour's style to adopt to draw isolines(by default, style=0. see style.pro) 150 ; 151 ; @keyword STY1D 152 ; --OBSOLETE-- 153 ; Number of the style used when we make a 1d drawing. We should better use the 154 ; keyword LINESTYLE which is tho one of the plot. Beware, this keyword is still 155 ; useful if we want to d bars instead of curves, put sty1d='bar' 156 ; 157 ; @keyword TREND_TYPE 158 ; Modify field by calling trends.pro 159 ; 160 ; @keyword TYPEIN 161 ; allows to specify the type of hovmoller we want to do 245 162 ; 'xt','yt','zt','t' 246 ; a l''aide d''un mot cle plutot que par l''argument type Si 247 ; l''argument et le mot cle sont specifies en meme temps, c''est 248 ; la valeur specifiee par le mot cle qui est retenue. 249 ; 250 ; /USETRI: pour forcer a utiliser de triangulation. 251 ; 252 ; UNLABSUR: entier n. specifant qu''on ne labelle qu''un 253 ; contour sur n. Par defaut unlabsur=2 254 ; 255 ; /UNSUR2: si on veut tracer un countour sur deux. par defaut trace 256 ; tous les contours 257 ; 258 ; WINDOW: nimero de la fenetre ou l''on veut faire le graphe (permet 259 ; d'ouvrir plusieurs fenetres). par defaut on ouvre 'IDL0' 260 ; 261 ; YXASPECT: rapport d'echelle entre y et x. Par defaut=1 262 ; Par defaut on adapte pour occupe une grande partie de la feuille en sortie 263 ; postScript ou pour cree une fenetre pas trop etiree 264 ; 265 ; /ZEROMIDDLE: fo force the middle of the colorbar to be equal 266 ; to 0 (force max=max(abs([min,max])) and min=-max) 267 ; 268 ; COMMON BLOCKS: 269 ; common.pro 270 ; 271 ; SIDE EFFECTS: 272 ; 273 ; RESTRICTIONS: 274 ; 275 ; EXAMPLE: 276 ; 277 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 163 ; with help of a keyword rather than the argument type. If the argument andthe 164 ; keyword are specified in the same time, it is the value specified by the 165 ; keyword which is retained. 166 ; 167 ; @uses 168 ; common.pro 169 ; 170 ; @history 171 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 278 172 ; 27/5/98 279 173 ; Jerome Vialard (adapting plt to hovmoller drawing) … … 281 175 ; Sebastien Masson 14/8/98 (continents,barres) 282 176 ; 15/1/98 283 ; adaptation pour les tableaux 3 et 4d pour que la moyenne soit faite 284 ; dans pltt plutot que lors de la lecture. 177 ; Adaptation for arrays 3 and 4d to the average be done in pltt rather than during the reading. 285 178 ; Sebastien Masson 14/8/98 286 179 ; 7/1999 … … 289 182 ; Sebastien Masson 08/02/2000 checkfield and 290 183 ; usetri keyword. 184 ; 185 ; @version 186 ; $Id$ 187 ; 188 ; @todo seb: L.24 à 36, L.426 à 427, L. 492 à 493 291 189 ;- 292 190 ;------------------------------------------------------------ … … 318 216 ;-------------------------------------------------------------- 319 217 ;------------------------------------------------------------ 320 tempsun = systime(1) ; pour key_performance321 ;-------------------------------------------------------------- 322 ; I2) reinitiali sation. !p.,!x.,!y.323 ; Rq: on ne reinitialise pas qd on rapelle plt en boucle pour utiliser contour218 tempsun = systime(1) ; For key_performance 219 ;-------------------------------------------------------------- 220 ; I2) reinitialization. !p.,!x.,!y. 221 ; Comment: we do not reinitializate when we call back plt in loop to use contour. 324 222 ;-------------------------------------------------------------- 325 223 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) $ 326 224 AND NOT keyword_set(ov1d) then reinitplt 327 225 ;-------------------------------------------------------------- 328 ; I1) lecture du champ226 ; I1) Reading of the field. 329 227 ;-------------------------------------------------------------- 330 228 if (keyword_set(boxzoom) OR keyword_set(endpoints)) $ … … 371 269 ENDELSE 372 270 ;--------------------------------------------------------------- 373 ; calcul de tendance/anomaly suivantTREND_TYPE271 ; Calculation of trend/anomaly following TREND_TYPE 374 272 ;--------------------------------------------------------------- 375 273 … … 379 277 380 278 ;--------------------------------------------------------------- 381 ; filtrage des donnee dans le cas 't'279 ; Filtering of fields in the 't' case. 382 280 ;--------------------------------------------------------------- 383 281 … … 390 288 391 289 ;--------------------------------------------------------------- 392 ; repetition de la serie temporelle290 ; Repetition of the temporal series 393 291 ;--------------------------------------------------------------- 394 292 … … 410 308 411 309 ;--------------------------------------------------------------- 412 ; selection du type de graphique.310 ; Selection of graphic's type. 413 311 ;--------------------------------------------------------------- 414 312 taille=size(z2d) … … 427 325 !x.range=!x.range-tempsmin 428 326 !x.tickv=!x.tickv-tempsmin 429 ; on fait un faux plot pour appliquer ces changements!327 ; We do a false plot to apply these changes! 430 328 plot,[0], [0],/noerase,xstyle=5, ystyle = 5, title = '', subtitle = '', ytitle = '', xtitle = '' 431 329 goto, trace1d 432 330 endif 433 331 end 434 435 ; on construit le mask pour cela le tableau doit etre masque (fait436 ; automatiquement a la valeur valmask si on passe ds moyenne ougrossemoyenne)332 endcase 333 ; We build the mask. For that, the table must be masked (automaticaly done at the 334 ; value valmask if we pass in moyenne or grossemoyenne) 437 335 nan = total(finite(z2d,/nan)) < 1 438 336 if n_elements(valmask) EQ 0 then valmask = 1e20 … … 447 345 ; min: min pour le dessin. 448 346 ;----------------------------------------------------------------------------- 449 ; faudra-t-il faire un autoscale ???347 ; Do we need to do an autoscale ??? 450 348 autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle) 451 349 determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle, _extra = ex 452 350 if z2d[0] EQ -1 THEN return 453 ; on fait un autoscale si besoin351 ; We do an autoscale if needed. 454 352 if autoscale then autoscale, min, max, intervalle 455 353 ;----------------------------------------------------------------------------- … … 459 357 ;-------------------------------------------------------------- 460 358 ;-------------------------------------------------------------- 461 ; 2 eme partie: dessin359 ; 2nd part: drawing 462 360 ;-------------------------------------------------------------- 463 361 ;----------------------------------------------------------- 464 ; definition des axes362 ; definition of axis 465 363 ;---------------------------------------------------------- 466 364 ;----------------------------------------------------------------------------- 467 ; definition des vecteurs abscisse et ordonee468 ; la triangulation est definie pour que le trace soit effectue du bas469 ; a gauche vers le haut a droite. il faut donc la matrice e contourer470 ; se presente de cette maniere, d''ou certains transpose etreverse471 ;----------------------------------------------------------------------------- 472 ;----------------------------------------------------------------------------- 473 ; definition des bornes de l''axe temporel365 ; definition of the abscisse and ordinate vectors. 366 ; The triangulation is defined in order to the drawing be done from the 367 ; left bottom to the right up. So the matrix have to be shown like this, 368 ; from which some transpose and reverse 369 ;----------------------------------------------------------------------------- 370 ;----------------------------------------------------------------------------- 371 ; definition of limits of the temporal axis 474 372 ;----------------------------------------------------------------------------- 475 373 case N_PARAMS() OF … … 533 431 ;------------------------------------------------------------ 534 432 ;------------------------------------------------------------ 535 ; d essin433 ; drawing 536 434 ;------------------------------------------------------------ 537 435 ; 2d … … 539 437 if (typdes eq '2d') then begin 540 438 ;-------------------------------------------------------------- 541 ; choi x deslabels439 ; choice of labels 542 440 ;----------------------------------------------------------- 543 441 if keyword_set(intervalle) AND NOT keyword_set(label) then label=1 … … 546 444 , INTERVALLE = intervalle, strictfill = strictfill 547 445 ;-------------------------------------------------------------- 548 ; choi x destyle446 ; choice of style 549 447 ;----------------------------------------------------------- 550 448 if not keyword_set(style) then style=0 … … 556 454 ; 557 455 if keyword_set(nan) then BEGIN 558 ; xx = xx#replicate(1, nby) ; on passe les axes en tableaux 2d456 ; xx = xx#replicate(1, nby) ; We make a 2d array with axes 559 457 ; yy = replicate(1, nbx)#yy 560 458 masknan = finite(z2d) … … 575 473 , coinmontemask=coinmontemask, coindescendmask=coindescendmask, _extra = ex 576 474 ;------------------------------------------------------------ 577 if n_elements(contour) eq 4 then BEGIN ; c''est la 2eme fois que je passe dspltt578 contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; je renvoie le min, le max et l''unite475 if n_elements(contour) eq 4 then BEGIN ; it is the second time I pass in pltt 476 contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; I send back the min, the max and the unity 579 477 return 580 478 endif … … 594 492 if keyword_set(overplot) then GOTO, fini 595 493 ;------------------------------------------------------------ 596 ; Trace de la ligne de changement de date or the equator494 ; Trace the line of change of date and the equator. 597 495 ;------------------------------------------------------------ 598 496 IF key_onearth THEN BEGIN … … 604 502 ENDIF 605 503 ;------------------------------------------------------------ 606 ; legendes + affichage de celles-ci504 ; caption + display of these. 607 505 ;------------------------------------------------------------ 608 506 legende,mi,ma,type, CONTOUR = pourlegende, DIREC = direc, INTERVALLE = intervalle $ … … 641 539 if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex 642 540 ;------------------------------------------------------------ 643 ; barre de couleur541 ; color bar 644 542 ;------------------------------------------------------------ 645 543 colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)] … … 654 552 if (typdes eq '1d') then begin 655 553 if (not keyword_set(col1d)) then col1d = 0 656 if keyword_set(sty1d) then BEGIN ; si on veut faire des barres554 if keyword_set(sty1d) then BEGIN ;if we want to make bars 657 555 IF strlowcase(strtrim(sty1d)) EQ 'bar' then begin 658 556 !y.range = [!y.range[0]-(!y.range[1]-!y.range[0])*.05,!y.range[1]] … … 661 559 colors = replicate(col1d, n_elements(yy)), /outline 662 560 if n_elements(ex) NE 0 then BEGIN 663 ; pour avoir un cadre de la couleur noire561 ; To have a black frame 664 562 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 665 563 ENDIF … … 691 589 ; => so we draw the top axis by hand using axis. 692 590 if n_elements(ex) NE 0 then BEGIN 693 ; pour avoir un cadre de la couleur noire591 ; To have a black frame 694 592 if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 695 593 ENDIF … … 711 609 fini: 712 610 ;------------------------------------------------------------ 713 ; on remet l''axe du temps en jours julien IDL et non pas en jours 714 ; juliens comptes a partir tempsmin 611 ; we reput time axis in IDL julian days and not in julian days count from tempsmin 715 612 ;------------------------------------------------------------ 716 613 if type EQ 'xt' then BEGIN … … 721 618 !x.tickv=!x.tickv+tempsmin 722 619 ENDELSE 723 ; on fait un faut plot pour que ces valeurs soient prises en 724 ; consideration 620 ; We do a false plot to these values are considerated 725 621 plot, [0], [0], /nodata, /noerase, xstyle = 5, ystyle = 5 $ 726 622 , title = '', subtitle = '', ytitle = '', xtitle = '' 727 623 ;------------------------------------------------------------ 728 624 ;------------------------------------------------------------ 729 ; 3 eme partie: impression eventuelle625 ; 3rd part: possible print 730 626 ;------------------------------------------------------------ 731 627 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME: 6 ; PLTZ 7 ; 8 ; PURPOSE: 9 ; trace des graphes verticaux 10 ; 11 ; CATEGORY: 12 ; Graphics 13 ; 14 ; CALLING SEQUENCE: 15 ; pltz, champ [,min[, max]] 16 ; 17 ; INPUTS: 18 ; champ: le champ dont on veut faire la coupe verticale champ 19 ; peut etre de 2 types: 20 ; 1) un tableau 2d ou 3d. 21 ; Si le champ est 2d undiquer avec le mot cle boxzoom les 22 ; delimitations geographiques de la boxzoom. Si le chyamp est 23 ; 3d, on extrait la section et on moyenne eventuellement avant 24 ; de faire le plot 25 ; 2) une structure repondant aux critaire specifies par 26 ; litchamp.pro. cf. IDL> xhelp,'litchamp'. le tableau contenu 27 ; ds la structure doit etre 2 ou 3d cf cas 1) si dessus 5 ; 6 ; @file_comments 7 ; Trace vertical graphs. 8 ; 9 ; @categories 10 ; Graphics 11 ; 12 ; @param TAB 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. 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. 18 ; See IDL> xhelp,'litchamp'. The array contin in the structure must be 2 or 3d (See case 1) 28 19 ; 29 20 ; ces arguments ne sont pas obligatoires: … … 35 26 ; des contours. Par defaut on prend le min de tab1 (sur les pts mer) 36 27 ; 37 ; KEYWORD PARAMETERS: 38 ; 39 ; BOXZOOM:vecteur indiquant la zone geographique sur laquelle doit etre 40 ; faite la coupe. Si BOXZOOM a : 41 ; 1 element : l''extraction est faite sur [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 42 ; 2 elements: l''extraction est faite sur [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 43 ; 4 elements: l''extraction est faite sur [Boxzoom, 0, 200] 44 ; 5 elements: l''extraction est faite sur [Boxzoom[0:3], 0, Boxzoom[4]] 45 ; 6 elements: l''extraction est faite sur Boxzoom 46 ; 47 ; Ou lon1, lon2,lat1,lat2 sont les variables globales 48 ; definies lors du dernier domdef! 49 ; 50 ; CB_TITLE: le titre de la colorbar 51 ; 52 ; CB_SUBTITLE: le soustitre de la colorbar 53 ; 54 ; CB_CHARSIZE: The character size of the color bar annotations 55 ; 56 ; CONTINTERVALLE: lorsque CONTOUR est active, valeur d'un 57 ; intervalle entre deux isolignes traces par un trait. Il peut ainsi 58 ; etre different de celui specifie par INTERVALLE 59 ; qui, cas ce cas, ne controle que les isolignes coloriees en 60 ; couleurs. Si aucun min n''est specifie, on choisit un contour min qui va 61 ; bien avec l''intervalle specifie!. Si ce mot cle n''est pas 62 ; specifie, on trace 20 isolignes du min au max. 63 ; 64 ; CONTLABEL: un entier n. lorsque CONTOUR est active, si n 65 ; different de 0, choisit le type de label correspondant aux cas n 66 ; pour les isolignes tracees par un trait. Pour specifier le type de 67 ; label du contour en couleur, utiliser LABEL 68 ; 69 ; CONTMAX: lorsque CONTOUR est active, valeur maximum que l''on 70 ; veut prendre en compte dans le trace des isolignes traces par un 71 ; trait. Par defaut on prend le max (sur les pts mer) 72 ; du tableau passe ds le mot cle CONTOUR. 73 ; 74 ; COAST_COLOR: the color of the coastline. 75 ; defaut value is 0 => black 76 ; 77 ; COAST_THICK: the thickness of the coastline. 78 ; defaut value is 1 79 ; 80 ; /CONT_NOFILL: activer pour ne pas remplir les points masques 81 ; pour les laisser en transparent! 82 ; Rq: on trace qd meme le contour du mask 83 ; 84 ; CONT_COLOR: the color of the continent. defaut value is 85 ; (!d.n_colors - 1) < 255 => white 86 ; 87 ; CONTMIN: lorsque CONTOUR est active, valeur minimum que l''on 88 ; veut prendre en compte dans le trace des isolignes traces par un 89 ; trait. Par defaut on prend le max (sur les pts mer) 90 ; du tableau passe ds le mot cle CONTOUR. 91 ; 92 ; CONTNLEVEL: lorsque CONTOUR est active, nombre de contours 93 ; trace par un trait a dessiner (actif si 94 ; CONTLABEL=0) par defaut =20. 95 ; 96 ; CONTOUR: si on veut tracer les contours d'un champ different que celui 97 ; que l''on dessin en couleur (par ex E-P en couleur et QSR en 98 ; contours). Doit etre un champ reponadnt aux meme caracteristiques 99 ; que l''argument numero 1 de pltz 100 ; 101 ; ENDPOINTS: mot clef specifiant que l'on veut faire une coupe 102 ; verticale en diagonale. les coordonnees des extremites de 103 ; celle-ci sont alors definies les 4 elements du vecteur 104 ; ENDPOINTS: [x1,y1,x2,y2] qui sont les coordonnees 105 ; 106 ; INTERVALLE: valeur d''un intervalle entre deux isolignes. Si 107 ; aucun min n''est specifie, on choisit un contour min qui va bien 108 ; avec l'intervalle specifie!. Si ce mot cle n''est pas specifie, on 109 ; trace 20 isolignes du min au max. Rq: Qd CONTOUR est active 110 ; INTERVALLE ne specifie que intervalle entre 2 isolignes coloriees en 111 ; couleur. Pour specifier l''intervalle entre 2 isolignes traces par un trait 112 ; utiliser CONTINTERVALLE. 113 ; 114 ; /INV: inverse le vecteur couleur utilisee pour colorier le graphe 115 ; (sans toucher au noir, au blanc et a la palette utilisee) 116 ; 117 ; ZRATIO: lorsque le dessin presente une partie zoomee, rapport de 118 ; taille entre la partie zommee, hz (hauteur zoom), et le dessin entier, ht 119 ; (hauteur total). Par defaut =2./3 120 ; 121 ; LABEL: un entier n. si n different de 0, choisit le type de 122 ; label correspondant aux cas n. cf label.pro 123 ; Rq: Qd CONTOUR est active, ne specifie le type de label que pour les 124 ; isolignes coloriees en couleur. Pour celles tracees par un trait 125 ; utiliser CONTLABEL. 126 ; 127 ; /LANDSCAPE: oblige la feuille ou la fenetre a etre en position 128 ; "allongee" 129 ; 130 ; LCT: entier designant le numero de la palette de couleur que 131 ; l''on veut utiliser pour le plot. 132 ; 133 ; MAXIN: permet de specifier la valeur maximum que l''on veut 134 ; prendre en compte dans le trace des contours a l''aide d''un 135 ; mot cle plutot que par l''argument max. Si l''argument et le 136 ; mot cle sont specifies en meme temps, c''est la valeur 137 ; specifiee par le mot cle qui est retenue. 138 ; 139 ; MININ: permet de specifier la valeur minimum que l''on veut 140 ; prendre en compte dans le trace des contours a l''aide d''un 141 ; mot cle plutot que par l''argument min. Si l''argument et le 142 ; mot cle sont specifies en meme temps, c''est la valeur 143 ; specifiee par le mot cle qui est retenue. 144 ; 145 ; NLEVEL: nombre de contours a dessiner. par defaut =20. actif si 146 ; LABEL=0 ou n'est pas specifie. 147 ; 148 ; /NOCOLORBAR: activer si on ne veut pas de colorbar 149 ; 150 ; /NOCONTOUR: activer si on ne veut pas de contour mais juste 151 ; les couleurs 152 ; 153 ; /NOFILL: activer si on veut juste les contours en noir et 154 ; blanc sur fond blanc 155 ; 156 ; /NOERASE: activer pour faire un dessin a l''ecran sans creer 157 ; une nouvelle fenetre 158 ; 159 ; /NOTRI: pour forcer a ne pas utiliser de triangulation. 160 ; 161 ; OVERPLOT: pour faire un plt par dessus un autre. Rq: 162 ; contrairemnet a l''utilisation de CONTOUR, 163 ; l''utilisation de ce mot clef ne modifie pas la legende ou/et 164 ; la barre de couleur. 165 ; 166 ; PETITDESSIN: vecteur de 3 ou 4 elements, applique pour faire un 167 ; dessin sur une petite portion de feuille ou d''ecran. il delimite 168 ; la zone ds laquelle va etre fait le dessin 169 ; si il a 4 elements: 170 ; il est alors constitute des coordonnees -exprime en cm reperes par 171 ; rapport au coin en bas a gauche de la feuille ou de la fenetre 172 ; (en portrait comme en landscape)- du coin en bas a 173 ; gauche et du coin en haut a droite de la zone de dessin. 174 ; si il a 3 elements: 175 ; Ds ce cas, on divise la fenetre ou l''ecran en PETITDESSIN[0] 176 ; colonnes, en PETITDESSIN[1] lignes le dessin se faisant ds la 177 ; case numero PETITDESSIN[2].La numerotation commencant en haut 178 ; a gauche par le numero 1 et suivant apres dans le sens de 179 ; l''ecriture. 180 ; Par defaut on fait un dessin occupant la plus grande place possible 181 ; tout en concervant le rapport d''aspect (sauf qd REMPLI est active) 182 ; 183 ; /PORTRAIT: oblige la feuille ou la fenetre a etre en position 184 ; "debout" 185 ; 186 ; /POST: faire une sortie postscript. Ne marche que si on fait 187 ; un seul dessin sur la feuille. Si on fait plusieurs dessins, 188 ; utiliser @ps ou plein2dessins 189 ; 190 ; /REMPLI:oblige le dessin a occuper l'espace maximum definit 191 ; par petitdessin 192 ; 193 ; /SIN: activer ce mot cle si l''on veut que l'' axe des x soit 194 ; trace en sinus de la latitude qd on fait une coupe 'yz' 195 ; 196 ; /STRICTFILL: activer ce mot clef pour que le remplissage des 197 ; contours ce fasse precisement entre le min et le max specifie 198 ; en laissant en banc les valeurs inferieurs au min specifie et 199 ; superieurs au max specifie. 200 ; 201 ; STYLE: style de tracer a adopter pour dessiner les isolignes par 202 ; defaut style=0. cf style.pro 203 ; 204 ; /TRANS: fait un postscript (active /post automatiquement) et l'imprime 205 ; -si on le desire- sur un transparant 206 ; 207 ; UNLABSUR: entier n. specifant qu''on ne labelle qu''un 208 ; contour sur n. Par defaut unlabsur=2 209 ; 210 ; /UNSUR2: si on veut tracer un countour sur deux. par defaut trace 211 ; tous les contours 212 ; 213 ; WINDOW: nimero de la fenetre ou l'on veut faire le graphe (permet 214 ; d'ouvrir plusieurs fenetres). par defaut on ouvre 'IDL0' 215 ; 216 ; /WDEPTH: to specify that the field is at W depth instad of T 217 ; depth (automatically activated if vargrid eq 'W') 218 ; 219 ; /XZ: force a faire une coupe xz 220 ; 221 ; /YZ: force a faire une coupe yz 222 ; 223 ; YXASPECT: rapport d'echelle entre y et x (par ex: =1 pour un repere 224 ; presque orthonorme, =2 si l'axe des y est environ deux fois plus dilate 225 ; que celui des x). Par defaut on adapte pour occupe une grande partie de 226 ; la feuille en sortie postScript ou pour cree une fenetre pas trop etiree 28 ; @keyword BOXZOOM 29 ; Vector indicating the geographic zone on which we want to cut the map. 30 ; If BOXZOOM has : 31 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 32 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 33 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 34 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 35 ; 6 elements: The extraction is made on Boxzoom 36 ; 37 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 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. 45 ; 46 ; @keyword CONTLABEL 47 ; It is an integer n. When CONTOUR is actvated, 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 50 ; colored contour, use LABEL 51 ; 52 ; @keyword CONTMAX 53 ; When CONTOUR is activated, max value we want to consider in the isoline 54 ; traced by a trait's line. By default, we take the max (on ocean points) of the array 55 ; passed in the keyword CONTOUR. 56 ; 57 ; @keyword CONTMIN 58 ; When CONTOUR is activated, min value we want to consider in the isoline 59 ; traced by a trait's line. By default, we take the min (on ocean points) of the array 60 ; passed in the keyword CONTOUR. 61 ; 62 ; @keyword CONTNLEVEL 63 ; When CONTOUR is activated, it is the numbre of contours 64 ; traced by a trait for drawing (active if 65 ; CONTLABEL=0) by default=20. 66 ; 67 ; @keyword CONTOUR 68 ; If we want to trace contours of a different field than the one 69 ; whose we have the colored drawing (by examlpe E-P in color and QSR in contours). 70 ; It must be a field respecting same caracteristics than the argument number one of plt. 71 ; 72 ; @keyword ENDPOINTS 73 ; keyword specifing that we want to make a vertical cut in diagonal. Then coorinated of extremities 74 ; of these one are difined by the 4 elements of the vector ENDPOINTS: [x1,y1,x2,y2] which are 75 ; coordinates. 76 ; 77 ; @keyword INTERVALLE 78 ; Value of an internal between to isoline. If there is none specified min, 79 ; we choose a min contour which goes well with the specified interval!. If this keyword is not 80 ; specified, we trace 20 isoline from the min to the max. Comment: When CONTOUR is activated, 81 ; INTERVALLE only specify the interval between 2 colored isoline. To specify the interval 82 ; between 2 isolines traced by a trait, use CONTINTERVALLE. 83 ; 84 ; @keyword INV 85 ; Invert the color vector used to color the graph 86 ; (without use the black, the white and the used palette) 87 ; 88 ; @keyword ZRATIO 89 ; When the drawing has a zoomed part, it is the size rapport between the zoomed part, 90 ; hz (zoom height), and the whole drawing, ht (total height). By default =2./3 91 ; 92 ; @keyword LABEL 93 ; It is an integer n. If n different of 0, it choose the label's type 94 ; corresponding to cases n. cf label.pro 95 ; Comment: When CONTOUR is activated, it only specify the label's type for colored isolines. 96 ; For tese one traced by a trait, use CONTLABEL. 97 ; 98 ; @keyword MAXIN 99 ; Allows to specify the max value we want to consider in the drawing of contour 100 ; helping by the keyword instead of the argument max. If the argument and the keyword are 101 ; specified in the same time, it is the value specified by the keyword which is retained. 102 ; 103 ; @keyword MININ 104 ; Allows to specify the min value we want to consider in the drawing of contour 105 ; helping by the keyword instead of the argument min. If the argument and the keyword are 106 ; specified in the same time, it is the value specified by the keyword which is retained. 107 ; 108 ; @keyword NLEVEL 109 ; Number of contour to draw by default =20. active if 110 ; LABEL=0 or is not specified. 227 111 ; 228 ; /WDEPTH: to specify that the field is at W depth instad of T 229 ; depth (automatically activated if vargrid eq 'W') 230 ; 231 ; ZOOM: profondeur jusqu'a laquelle on fait un zoom. par defaut 200m ou 232 ; la profondeur maximale si elle est inf a 200 233 ; 234 ; /ZEROMIDDLE: fo force the middle of the colorbar to be equal 235 ; to 0 (force max=max(abs([min,max])) and min=-max) 236 ; 237 ; OUTPUTS: 238 ; 239 ; COMMON BLOCKS: 240 ; common.pro 241 ; 242 ; SIDE EFFECTS: 243 ; 244 ; RESTRICTIONS: 245 ; 246 ; EXAMPLE: 247 ; 248 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 249 ; 7/1999 250 ; Sebastien Masson 08/02/2000 checkfield and 251 ; notri keyword. 112 ; @keyword NOTRI 113 ; To force not to use the triangulation. Beware, in this case, the 114 ; drawing only works if the grid is undeformed (It means that each point of a longitude 115 ; give one latitude and each point of a latitude give one longitude) exept if we use 116 ; the keyword CELL_FILL=2. 117 ; Comment: if the field contain points !values.f_nan, then we even do a triangulation. 118 ; 119 ; @keyword OVERPLOT 120 ; To make a plot over an other one. 121 ; Comment: Contrarily to the use of CONTOUR or VECTEUR, the use of this keyword 122 ; does not the caption and/or the color bar. 123 ; 124 ; @keyword SIN 125 ; Activate this keyword if we want the x axis to be traced in sinus of the 126 ; latitude when we make a drawing f(y) 127 ; 128 ; @keyword STRICTFILL 129 ; Activate this keyword to that the filling of contours be 130 ; precisely done between the min and the max specified letting values inferior at the 131 ; specified min and values superior at the specified max in white. 132 ; 133 ; @keyword STYLE 134 ; Contour's style to adopt to draw isolines(by default, style=0. see style.pro) 135 ; 136 ; @keyword WDEPTH 137 ; To specify that the field is at W depth instead of T 138 ; depth (automatically activated if vargrid eq 'W') 139 ; 140 ; @keyword XZ 141 ; Force to make a cut following xz 142 ; 143 ; @keyword YZ 144 ; Force to make a cut following yz 145 ; 146 ; @keyword ZOOM 147 ; Depth where i can make our maximum zoom. By default 200m or max depth if it is inferior at 200m 148 ; 149 ; @uses 150 ; common.pro 151 ; 152 ; @history 153 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 154 ; 7/1999 155 ; Sebastien Masson 08/02/2000 checkfield and 156 ; notri keyword. 157 ; 158 ; @version 159 ; $Id$ 160 ; 161 ; @todo seb L.20 à 26, L.215 à 221 162 ; 252 163 ;- 253 164 ;------------------------------------------------------------ … … 277 188 ENDIF 278 189 ;-------------------------------------------------------------- 279 tempsun = systime(1) ; pour key_performance280 ;------------------------------------------------------------ 281 ;-------------------------------------------------------------- 282 ; 1 ere partie: initialisation et petits calculs...283 ;-------------------------------------------------------------- 284 ; on ne reinitialise pas qd on rapelle pltz en boucle pour utiliser contour190 tempsun = systime(1) ; For key_performance 191 ;------------------------------------------------------------ 192 ;-------------------------------------------------------------- 193 ; 1st part: initialization small calculations... 194 ;-------------------------------------------------------------- 195 ; Comment: we do not reinitializate when we call back plt in loop to use contour. 285 196 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) then reinitplt 286 197 ; 287 198 if n_elements(contour) ne 4 THEN saveboxparam, 'boxparam4pltz.dat' 288 199 ;-------------------------------------------------------------- 289 ; lecture du champ200 ; Reading of the field. 290 201 ;-------------------------------------------------------------- 291 202 if n_elements(giventype) NE 0 then type = giventype … … 352 263 z2d = reverse(z2d, 2) 353 264 ;----------------------------------------------------------------------------- 354 ; determination du mi:min et du ma:max de tab1 ainsi que de max: max et355 ; min: min pour le dessin.265 ; Determination of the mi:min and of the ma:max of z2d in the same way 266 ; as max: max and min: min for the drawing. 356 267 ;----------------------------------------------------------------------------- 357 268 nan = total(finite(z2d, /nan)) < 1 358 ; faudra-t-il faire un autoscale ???269 ; Do we need to do an autoscale ??? 359 270 autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle) 360 271 determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle, _extra = ex 361 272 if z2d[0] EQ -1 THEN GOTO, sortie 362 ; on fait un autoscale si besoin273 ; We do an autoscale if needed. 363 274 if autoscale then autoscale, min, max, intervalle 364 275 ;-------------------------------------------------------------- 365 276 ;-------------------------------------------------------------- 366 ; 2 eme partie: dessin277 ; 2nd part: drawing 367 278 ;-------------------------------------------------------------- 368 279 ;-------------------------------------------------------------- … … 372 283 ;------------------------------------------------------------ 373 284 ;-------------------------------------------------------------- 374 ; choi x deslabels285 ; choice of labels 375 286 ;----------------------------------------------------------- 376 287 if keyword_set(intervalle) AND NOT keyword_set(label) then label = 1 … … 379 290 , INTERVALLE = intervalle, strictfill = strictfill 380 291 ;-------------------------------------------------------------- 381 ; choi x destyle292 ; choice of style 382 293 ;----------------------------------------------------------- 383 294 if not keyword_set(style) then style = 0 … … 385 296 if keyword_set(inv) then colnumb = reverse(colnumb) 386 297 ;----------------------------------------------------------- 387 ; definition desaxes298 ; definition of axes 388 299 ;---------------------------------------------------------- 389 300 if NOT keyword_set(overplot) THEN axe, type, SIN = sin, _EXTRA = ex 390 301 !y.range = [-1, 0] 391 302 ;-------------------------------------------------------------- 392 ; extrapolation des donnees sur les terres et seuillage303 ; extrapolation of datas on lands and specifying of the min/max value 393 304 ;-------------------------------------------------------------- 394 305 ; define masknan … … 403 314 , mask = mask*masknan, /basique $ 404 315 , /fillxdir, _extra = ex) 405 ; if some lines contains no data(the bottom line for ex) it must be316 ; if some lines contains no field (the bottom line for ex) it must be 406 317 ; also filled with 8 neighbourg method 407 318 IF (where(total(mask*masknan, 1) EQ 0))[0] NE -1 THEN $ … … 459 370 , REALSECTION = realsection, USETRI = usetri, _extra = ex 460 371 ;------------------------------------------------------------ 461 ; r appelle de pltz en boucle qd contour est active462 ;------------------------------------------------------------ 463 if n_elements(contour) eq 4 then BEGIN ; c''est la 2eme fois que je passe dspltt464 contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; je renvoie le min, le max et l''unite372 ; recall of pltz in loop when contour is activated 373 ;------------------------------------------------------------ 374 if n_elements(contour) eq 4 then BEGIN ; It is the second time I pass in pltt 375 contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; I send back the min, the max and the unity 465 376 return 466 377 endif … … 479 390 ;------------------------------------------------------------ 480 391 ;------------------------------------------------------------ 481 ; 3 eme partie: dessin du cadre, legendes, colorbar...392 ; 3rd part: drawing of the frame, caption, colorbar... 482 393 ;------------------------------------------------------------ 483 394 if keyword_set(overplot) then BEGIN 484 !y.range = [zoom, profmin] ; on repasse en coordonees physiques!395 !y.range = [zoom, profmin] ; We get back on physic coordinates 485 396 plot, [0], [0], /nodata, /noerase, title = '', subtitle = '', xstyle = 5, ystyle = 5 486 397 GOTO, fini 487 398 endif 488 399 ;------------------------------------------------------------ 489 ; legendes + affichage de celles-ci400 ; Caption + dysplay of them 490 401 ;------------------------------------------------------------ 491 402 legende, mi, ma, type, CONTOUR = pourlegende, INTERVALLE = intervalle, DIREC = direc, endpoints = endpoints, _EXTRA = ex 492 403 if type eq 'yz' then xaxe = 'lataxe' else xaxe = 'lonaxe' 493 404 if keyword_set(sin) OR NOT key_onearth then xaxe = '' 494 ; cadre applique par defaut405 ; Frame applied by default 495 406 plot, [xxaxis[0], xxaxis[n_elements(xxaxis)-1]], [-zratio, -zratio], /noerase $ 496 407 , xstyle = 1+4*(keyword_set(endpoints) AND ((type EQ 'xz' AND lat1 NE lat2) OR (type EQ 'yz' AND lon1 NE lon2))) $ 497 408 , xtickformat = xaxe, _extra = ex 498 ; ajout d'un axe ds le cas ou l'on utilise endpoints409 ; Add of an axis in the case of we use endpoints 499 410 if keyword_set(endpoints) then addaxe, endpoints, type, posfenetre, _EXTRA = ex 500 411 ;------------------------------------------------------------ 501 ; axe y en 1 ou 2 parties412 ; Y axis in 1 or 2 part 502 413 ;------------------------------------------------------------ 503 414 if n_elements(ex) NE 0 then BEGIN 504 ; pour ne plus mettre de titre415 ; To do not put title anymore 505 416 if (where(tag_names(ex) EQ 'TITLE'))[0] NE -1 then ex.TITLE = ' ' 506 ; pour ne plus mettre de sous titre417 ; To do not put subtitle anymore 507 418 if (where(tag_names(ex) EQ 'SUBTITLE'))[0] NE -1 then ex.SUBTITLE = ' ' 508 ; pour n''avoir q''unytitle419 ; To have just one ytitle 509 420 if (where(tag_names(ex) EQ 'YTITLE'))[0] NE -1 then BEGIN 510 421 ytitle = ex.YTITLE … … 518 429 , position = posfenetre+[0, 0, 0, -hzoom], _extra = ex, title = '', subtitle = '', ytitle = '' 519 430 ; 520 !y.range = [zoom, profmin] ; on repasse en coordonees physiques!431 !y.range = [zoom, profmin] ; We get back in physic coordinates! 521 432 plot, [0], [0], /nodata, /noerase, ystyle = 1, _extra = ex $ 522 433 , title = '', subtitle = '', ytitle = '', position = posfenetre+[0, htotal-hzoom, 0, 0] 523 434 ;------------------------------------------------------------ 524 ; pour ecrire le ytitle...435 ; to write the ytitle... 525 436 ;------------------------------------------------------------ 526 437 if !d.name EQ 'PS' then $ … … 539 450 540 451 ;------------------------------------------------------------ 541 ; barre de couleur452 ; colorbar 542 453 ;------------------------------------------------------------ 543 454 colnumb = colnumb[0:ncontour-1-keyword_set(strictfill)] … … 546 457 ;------------------------------------------------------------ 547 458 ;------------------------------------------------------------ 548 ; 4 eme partie: impression eventuelle459 ; 4th part: possible print 549 460 ;------------------------------------------------------------ 550 461 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/sbar_plot.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:sbar_plot (super bar_plot)6 5 ; 7 ; PURPOSE: meme chose que bar_plot mais compatible avec l''ensemble de8 ; l'environnement (common.pro est inclu)6 ; @file_comments 7 ; Same thing that bar_plot but compatible with the whole environnement (common.pro inclued) 9 8 ; 10 ; CATEGORY:dessine9 ; @categories graphics 11 10 ; 12 ; CALLING SEQUENCE: sbar_plot,y13 ;14 11 ; INPUTS: cd IDL>?bar_plot 15 12 ; 16 ; KEYWORD PARAMETERS: 13 ; @keyword COLORS 14 ; A vector, the same size as VALUES, containing the color index 15 ; to be used for each bar. If not specified, the colors are 16 ; selected based on spacing the color indices as widely as 17 ; possible within the available colors (specified by D.N_COLORS). 17 18 ; 18 ; meme que ceux de bar_plot avec en plus: 19 ; COLORS: un entier donnant la couleur de toutes les barres de 20 ; couleurs. (contrairement a colors qui est en vecteur donnant le 21 ; couleur de chaque barre de couleur. 19 ; @keyword COLORS 20 ; Is an integer giving color of all colorbars. (contrarily to colors 21 ; which is a vector giving the color of each colorbar). 22 22 ; 23 ; NOREINITPLT: a actier si on ne veut pas que les variables24 ; d''environnemet !p, !x, !y, !z soient reinitialisees par la25 ; 23 ; @keyword NOREINITPLT 24 ; We active it if we do not want environnement variables !p, !x, !y, !z 25 ; to be reinitilalizted by the procedure reinitplt 26 26 ; 27 ; OUTPUTS: 27 ; @keyword _EXTRA 28 ; used to pass your keyword 28 29 ; 29 ; COMMON BLOCKS:common.pro 30 ; @uses 31 ; common.pro 30 32 ; 31 ; SIDE EFFECTS: 33 ; @restrictions 34 ; If NOREINITPLT is not activated, all environnement 35 ; variables !p, !x, !y, !z are reinitializtedby the procedure reinitplt 32 36 ; 33 ; Si NOREINITPLT n''est pas ective toutes les variables 34 ; d''environnemet !p, !x, !y, !z sont reinitialisees par la 35 ; procedure reinitplt 36 ; 37 ; RESTRICTIONS: 38 ; 39 ; EXAMPLE: 40 ; 37 ; @examples 41 38 ; IDL> sbar_plot, indgen(10),small = [2,2,2],/rempli 42 39 ; IDL> sbar_plot, indgen(10),small = [2,2,3],/noerase 43 ; IDL> @ps40 ; IDL> \@ps 44 41 ; 45 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 42 ; @history 43 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 46 44 ; 10/10/1999 45 ; 46 ; @version 47 ; $Id$ 48 ; 47 49 ;- 48 50 ;------------------------------------------------------------ … … 55 57 ; 56 58 @common 57 ; 1) je reinitialise l''environnememt graphique (lesvariables !x, !y et !p):59 ; 1) I reinitialize the graphic environment (variables !x, !y et !p): 58 60 if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex 59 ; 2) je place le dessin a l'ecran comme sur le postcript61 ; 2) I place the drawing on the screen like on the postscript 60 62 IF chkstru(ex, 'overplot')EQ 0 THEN placedessin, 'autre', _extra = ex 61 ; 3) je fais mon joli dessin63 ; 3) Drawing 62 64 if n_elements(COLORS) NE 0 then BEGIN 63 65 if n_elements(COLORS) EQ n_elements(Values) then col = colors $ … … 67 69 bar_plot, Values, background = !p.background, colors = col $ 68 70 , xstyle = 1, ystyle = 1, _extra = ex 69 ; 4) je termine le dessin71 ; 4) End of drawing 70 72 terminedessin, _extra=ex 71 73 -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/scontour.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:scontour (super contour)6 5 ; 7 ; PURPOSE: meme chose que contour mais compatible avec l''ensemble de8 ; l'environnement (common.pro est inclu)6 ; @File_comments 7 ; Same thing that contour but compatible with the whole environnement (common.pro inclued) 9 8 ; 10 ; CATEGORY:dessine9 ; @categories graphics 11 10 ; 12 ; CALLING SEQUENCE: scontour, z [, x, y]13 ;14 11 ; INPUTS:cd IDL>?contour 15 12 ; 16 ; KEYWORD PARAMETERS: 13 ; @keyword NOREINITPLT 14 ; We active it if we do not want environnement variables !p, !x, !y, !z 15 ; to be reinitilalizted by the procedure reinitplt 16 ; 17 ; @keyword _EXTRA 18 ; used to pass your keywords 17 19 ; 18 ; meme que ceux de bar_plot avec en plus: 19 ; NOREINITPLT: a actier si on ne veut pas que les variables 20 ; d''environnemet !p, !x, !y, !z soient reinitialisees par la 21 ; procedure reinitplt 20 ; @uses 21 ; common.pro 22 22 ; 23 ; OUTPUTS: 24 ; 25 ; COMMON BLOCKS:common.pro 26 ; 27 ; SIDE EFFECTS: 28 ; 29 ; RESTRICTIONS: 30 ; 31 ; EXAMPLE: 23 ; @examples 32 24 ; IDL> z = dist(100) 33 25 ; IDL> scontour, z, nlevels=10,small=[1,2,1],xstyle=1,ystyle=1 34 ; IDL> @ps26 ; IDL> \@ps 35 27 ; 36 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)28 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 37 29 ; 10/10/1999 30 ; 31 ; @version 32 ; $Id$ 33 ; 38 34 ;- 39 35 ;------------------------------------------------------------ … … 45 41 ; 46 42 @common 47 ; 1) je reinitialise l''environnememt graphique (lesvariables !x, !y et !p):43 ; 1) I reinitializate the graphic environment (variables !x, !y et !p): 48 44 if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex 49 ; 2) je place le dessin a l'ecran comme sur le postcript45 ; 2) i put the drawing on the screen like on the postcript 50 46 ; if ex contains norease and c_orientation keywords we force ex.noerase = 0 51 47 IF chkstru(ex, 'overplot') EQ 0 THEN placedessin, 'autre', _extra = ex 52 48 ; fiddle when noerase is used with c_orentation... 53 ; call contour with /nodata to get the graphic env oronment, then force49 ; call contour with /nodata to get the graphic environment, then force 54 50 ; noerase = 0 and overplot = 1 55 51 IF size(ex, /type) EQ 8 THEN BEGIN … … 85 81 ENDCASE 86 82 ENDIF 87 ; 4) je termine le dessin83 ; 4) End of drawing 88 84 terminedessin, _extra = ex 89 85 -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/splot.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:splot (super plot)6 5 ; 7 ; PURPOSE: meme chose que plot mais compatible avec l''ensemble de8 ; l'environnement (common.pro est inclu)6 ; file_comments 7 ; Same thing that plot but compatible with the whole environnement (common.pro inclued) 9 8 ; 10 ; CATEGORY:dessine 11 ; 12 ; CALLING SEQUENCE: PLOT, [X,] Y 9 ; @categories graphics 13 10 ; 14 11 ; INPUTS:cd IDL> ?plot 15 12 ; 16 ; KEYWORD PARAMETERS: 17 ; meme que ceux de plot avec en plus: 13 ; @keyword NOREINITPLT 14 ; We active it if we do not want environnement variables !p, !x, !y, !z 15 ; to be reinitilalizted by the procedure reinitplt 16 ; 17 ; @keyword _EXTRA 18 ; used to pass your keywords 18 19 ; 19 ; NOREINITPLT: a actier si on ne veut pas que les variables 20 ; d''environnemet !p, !x, !y, !z soient reinitialisees par la 21 ; procedure reinitplt 20 ; @uses 21 ; common.pro 22 22 ; 23 ; OUTPUTS: 23 ; @restrictions 24 ; If NOREINITPLT is not activated, all environnement 25 ; variables !p, !x, !y, !z are reinitializtedby the procedure reinitplt 24 26 ; 25 ; Si NOREINITPLT n''est pas ective toutes les variables 26 ; d''environnemet !p, !x, !y, !z sont reinitialisees par la 27 ; procedure reinitplt 28 ; 29 ; COMMON BLOCKS:common.pro 30 ; 31 ; SIDE EFFECTS: 32 ; 33 ; RESTRICTIONS: 34 ; 35 ; EXAMPLE: 36 ; 27 ; @examples 37 28 ; IDL> splot, indgen(10),ystyle=1,small=[1,2,1],/portrait 38 29 ; IDL> splot, -indgen(10),ystyle=1,small=[1,2,2],/noerase 39 ; IDL> @ps30 ; IDL> \@ps 40 31 ; 41 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 32 ; @history 33 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 42 34 ; 18/10/1999 35 ; 36 ; @version 37 ; $Id$ 38 ; 43 39 ;- 44 40 ;------------------------------------------------------------ … … 50 46 ; 51 47 @common 52 ; 1) je reinitialise l''environnememt graphique(les variables !x, !y et !p):48 ; 1) I reinitializate the graphic environment (les variables !x, !y et !p): 53 49 if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex 54 ; 2) je place le dessin a l'ecran comme sur le postcript50 ; 2) i put the drawing on the screen like on the postcript 55 51 placedessin, 'autre', _extra = ex 56 ; 3) je fais mon joli dessin52 ; 3) Drawing 57 53 if n_elements(y) EQ 0 then plot, x, xstyle = 1, ystyle = 1, _EXTRA = ex $ 58 54 ELSE plot, x, y, xstyle = 1, ystyle = 1, _EXTRA = ex 59 ; 4) je termine le dessin55 ; 4) End of drawing 60 56 terminedessin, _extra=ex 61 57 ; -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/tvplus.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME: tvplus 6 ; 7 ; PURPOSE: enhanced version of tvscl 8 ; 9 ; CATEGORY: quick exploration of 2D arrays 10 ; 11 ; CALLING SEQUENCE: tvplus,z2d [,cellsize] 5 ; 6 ; @file_comments 7 ; Enhanced version of tvscl 8 ; 9 ; @categories quick exploration of 2D arrays 12 10 ; 13 11 ; INPUTS: 14 12 ; 15 ; z2d: 2D array to visualize 16 ; 17 ; cellsize: (optional) this is the size (in pixel) of the square 18 ; representing 1 array element. By default, this size is computed 19 ; automatically in order that the size of the plotting window do 20 ; not exceed the screen size. If the user specify a large value 21 ; of cellsize that forces tvplus to create a window larger than 22 ; the screen, a "scrolling window" will be displayed instead of a 23 ; regular window. Unfortunately the nice fonctionnalities of tvplus 24 ; are not coded for "scrolling window" case... 25 ; 26 ; KEYWORD PARAMETERS: 27 ; 28 ; BOTTOM: The lowest color index of the colors to be loaded in 29 ; the bar. default is 0. 30 ; 31 ; C_NAN: The color number that should be used for the NaN values. 32 ; default value is !d.n_colors < 255 33 ; 34 ; C_MASK: The color number that should be used for the mask values. 35 ; default value is 0 36 ; 37 ; OFFSET: 2 elements vector used by tvplus itself when shoing zoom. 38 ; It is used to shift the ranges of xaxis and yaxis. 39 ; For example: tvplus,sst[x1:x2,y1:y2],offest=[x1,y1] 40 ; 41 ; MASK: The mask value. Note that if abs(mask) < 1.e6, then the 42 ; exact value of the mask is used to find the maskwd point. 43 ; if abs(mask) > 1.e6, the test to find the masked value is ge 44 ; abs(mask)/10. This is necessary to avoid the rounding errors 45 ; 46 ; MIN and MAX: scalars used to specify the min and max values 47 ; of the color bar. default is from 0 to !d.n_colors < 255 48 ; 49 ; NCOLORS: This is the number of colors in the color 50 ; bar. default is !d.n_colors<255 -1 51 ; 52 ; NOINTERP: used this keyword if you don't whant that the values 53 ; are interpolated between 0 (or min) and !d.n_colors < 255 (or max). 54 ; This can be for example usefull when working on byte type arrays. 55 ; 56 ; NOUSEINFOS: activite to supress the printed message explaining 57 ; how to use tvplus 58 ; 59 ; WINDOW: Number of the window used to display the array values. 60 ; default is window number 0. 61 ; 62 ; OUTPUTS: no (except the printed finformations, see below) 63 ; 64 ; COMMON BLOCKS: no 65 ; 66 ; SIDE EFFECTS: 67 ; 13 ; @param Z2D {in}{required} 14 ; 2D array to visualize 15 ; 16 ; @param CELLSIZE {in}{optiona} 17 ; This is the size (in pixel) of the square 18 ; representing 1 array element. By default, this size is computed 19 ; automatically in order that the size of the plotting window do 20 ; not exceed the screen size. If the user specify a large value 21 ; of cellsize that forces tvplus to create a window larger than 22 ; the screen, a "scrolling window" will be displayed instead of a 23 ; regular window. Unfortunately the nice fonctionnalities of tvplus 24 ; are not coded for "scrolling window" case... 25 ; 26 ; @keyword BOTTOM 27 ; The lowest color index of the colors to be loaded in 28 ; the bar. default is 0. 29 ; 30 ; @keyword C_NAN 31 ; The color number that should be used for the NaN values. 32 ; default value is !d.n_colors < 255 33 ; 34 ; @keyword C_MASK 35 ; The color number that should be used for the mask values. 36 ; default value is 0 37 ; 38 ; @keyword OFFSET 39 ; 2 elements vector used by tvplus itself when shoing zoom. 40 ; It is used to shift the ranges of xaxis and yaxis. 41 ; For example: tvplus,sst[x1:x2,y1:y2],offest=[x1,y1] 42 ; 43 ; @keyword MASK 44 ; The mask value. Note that if abs(mask) < 1.e6, then the 45 ; exact value of the mask is used to find the maskwd point. 46 ; if abs(mask) > 1.e6, the test to find the masked value is ge 47 ; abs(mask)/10. This is necessary to avoid the rounding errors 48 ; 49 ; @keyword MIN 50 ; Scalar used to specify the min value of the color bar. default is 0 51 ; 52 ; @keyword MAX 53 ; Scalar used to specify the max value of the color bar. default is !d.n_colors < 255 54 ; 55 ; @keyword NCOLORS 56 ; This is the number of colors in the color bar. default is !d.n_colors<255 -1 57 ; 58 ; @keyword NOINTERP 59 ; Used this keyword if you don't whant that the values 60 ; are interpolated between 0 (or min) and !d.n_colors < 255 (or max). 61 ; This can be for example usefull when working on byte type arrays. 62 ; 63 ; @keyword NOUSEINFOS 64 ; Activite to supress the printed message explaining how to use tvplus 65 ; 66 ; @keyword WINDOW 67 ; Number of the window used to display the array values. 68 ; default is window number 0. 69 ; 70 ; @restrictions 68 71 ; use your mouse to scan the array values... 69 72 ; left button : mouse position and associated array value … … 71 74 ; right button : quit 72 75 ; 73 ; RESTRICTIONS: the nice fonctionnalities of tvplus are not coded 74 ; for "scrolling window" case... 75 ; 76 ; EXAMPLE: IDL> tvplus, dist(100) 77 ; 78 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 76 ; the nice fonctionnalities of tvplus are not coded 77 ; for "scrolling window" case... 78 ; 79 ; @examples 80 ; IDL> tvplus, dist(100) 81 ; 82 ; @history 83 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 79 84 ; 18/12/98 80 85 ; Aug 2005: quick cleaning + english 86 ; 87 ; @version 88 ; $Id$ 89 ; 81 90 ;- 82 91 ;------------------------------------------------------------ … … 246 255 device, decomposed = 0 247 256 endif 248 slide_image, arr $ ; on le dessine ds une fenetre avec unescrolling bar257 slide_image, arr $ ; We draw it in a window with a scrolling bar 249 258 , xsize = nx, ysize = ny $ 250 259 , xvisible = round(.7*dimensions[0]) < (size(arr))[1] $
Note: See TracChangeset
for help on using the changeset viewer.