- Timestamp:
- 05/02/06 17:24:47 (18 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ToBeReviewed/PLOTS/axe.pro
r41 r42 25 25 ; date. Par defaut c''est un retour a la ligne qd on fait un 26 26 ; 'yt', 'zt' ou 't' dans les autres cas c''est un blanc. 27 ; 28 ; DIGITSYEAR=2 to use %Z format (2 digits) to code years 29 ; instead of %Y format. See help of label_date for more 30 ; informations on %Z and %Y. 27 31 ; 28 32 ; OUTPUTS:les variables globales d''environnement graphique: !x. et !y. … … 45 49 ;------------------------------------------------------------ 46 50 ;------------------------------------------------------------ 47 PRO axe, coupe,tempsmin,tempsmax, REVERSE_X = reverse_x, REVERSE_Y = reverse_y, SIN = sin, SEPDATE = sepdate, _EXTRA = ex51 PRO axe, coupe,tempsmin,tempsmax, REVERSE_X = reverse_x, REVERSE_Y = reverse_y, SIN = sin, SEPDATE = sepdate, DIGITSYEAR = digitsyear, _EXTRA = ex 48 52 @common 49 53 tempsun = systime(1) ; pour key_performance … … 60 64 caldat,tempsmin, mmin, dmin, ymin, hmin, mnmin, smin, _EXTRA = ex 61 65 caldat,tempsmax, mmax, dmax, ymax, hmax, mnmax, smax, _EXTRA = ex 62 63 66 ; format used for the year (2 or 4/5 digits). 67 IF NOT keyword_set(digitsyear) THEN digitsyear = 4 68 IF digitsyear EQ 2 THEN fmtyr = '%Z' ELSE fmtyr = '%Y' 69 ; 64 70 if ymax EQ ymin then BEGIN 65 71 if mmin ne mmax then BEGIN … … 69 75 for m = 0,nticks-1 do ticknom[m] = julday(m+mmin, 1, ymin, _EXTRA = ex) 70 76 tminor = 6 71 datfmt = '%M'+sep+ '%Z'77 datfmt = '%M'+sep+fmtyr 72 78 ; on verifie que les labels rentrent bien entre tempsmin et tempsmax... 73 79 ticknom = ticknom[where(ticknom GE tempsmin AND ticknom LE tempsmax AND ticknom NE -1)] … … 75 81 ; cas particulier ou l''on est a cheval sur 2 mois 76 82 if nticks LE 1 then begin 77 nticks = (dmax+ jourdsmois(mmin, ymin)-dmin+1)/283 nticks = (dmax+(jourdsmois(mmin, ymin))[0]-dmin+1)/2 78 84 ticknom = lonarr(nticks) 79 85 for d = 0,nticks-1 do ticknom[d] = julday(mmin, d*2+dmin, ymin, _EXTRA = ex) … … 109 115 ; plusieurs annees 110 116 CASE 1 OF 111 ymax-ymin+1 LE 10: BEGIN & freq = 1. & tminor = 12 & datfmt = '%M'+sep+'%Z' & end 112 ymax-ymin+1 LE 20: BEGIN & freq = 2. & tminor = 6 & datfmt = '%M'+sep+'%Z' & end 113 ymax-ymin+1 LE 50: BEGIN & freq = 5. & tminor = 5 & datfmt = '%M'+sep+'%Z' & end 114 ymax-ymin+1 LE 100: BEGIN & freq = 10. & tminor = 10 & datfmt = '%Z' & end 115 ELSE : BEGIN & freq = 20 & tminor = 20 & datfmt = '%Y' & end 117 ymax-ymin+1 LE 10: BEGIN & freq = 1. & tminor = 12 & datfmt = '%M'+sep+fmtyr & end 118 ymax-ymin+1 LE 20: BEGIN & freq = 2. & tminor = 6 & datfmt = '%M'+sep+fmtyr & end 119 ymax-ymin+1 LE 50: BEGIN & freq = 5. & tminor = 5 & datfmt = '%M'+sep+fmtyr & end 120 ymax-ymin+1 LE 100: BEGIN & freq = 10. & tminor = 10 & datfmt = fmtyr & end 121 ymax-ymin+1 LE 1000: BEGIN & freq = 50. & tminor = 5 & datfmt = fmtyr & end 122 ELSE : BEGIN & freq = 100. & tminor = 50 & datfmt = '%Y' & end 116 123 ENDCASE 117 124 nticks = floor((ymax-ymin)/freq)+1 … … 132 139 nticks = n_elements(ticknom) 133 140 tminor = 6 134 datfmt = '%M'+sep+ '%Z'141 datfmt = '%M'+sep+fmtyr 135 142 ; cas particulier ou l''on est a cheval sur 2 mois 136 143 if nticks LE 1 then begin 137 nticks = (dmax+ jourdsmois(mmin, ymin)-dmin+1)/2144 nticks = (dmax+(jourdsmois(mmin, ymin))[0]-dmin+1)/2 138 145 ticknom = lonarr(nticks) 139 146 for d = 0,nticks-1 do ticknom[d] = julday(mmin, d*2+dmin, ymin, _EXTRA = ex) … … 156 163 if keyword_set(reverse_x) then !x.range=[lon2,lon1] ELSE !x.range=[lon1,lon2] 157 164 if keyword_set(reverse_y) then !y.range=[lat2,lat1] ELSE !y.range=[lat1,lat2] 158 !x.tickformat='lonaxe'159 !y.tickformat='lataxe'165 IF key_onearth THEN !x.tickformat='lonaxe' 166 IF key_onearth THEN !y.tickformat='lataxe' 160 167 END 161 168 'yz':BEGIN … … 187 194 if keyword_set(reverse_y) then !y.range=[tempsmax, tempsmin]-tempsmin $ 188 195 ELSE !y.range=[tempsmin,tempsmax]-tempsmin 189 !x.tickformat='lonaxe'190 ; result = LABEL_DATE(DATE_FORMAT = '%M'+sep+ '%Z')196 IF key_onearth THEN !x.tickformat='lonaxe' 197 ; result = LABEL_DATE(DATE_FORMAT = '%M'+sep+fmtyr) 191 198 ; !y.tickformat='LABEL_DATE' 192 199 !y.tickname = LABEL_DATE(1, 0,ticknom,_EXTRA = ex) … … 203 210 ELSE !x.range=[tempsmin,tempsmax]-tempsmin 204 211 if keyword_set(reverse_y) then !y.range=[lat2, lat1] ELSE !y.range=[lat1,lat2] 205 !y.tickformat='lataxe'212 IF key_onearth THEN !y.tickformat='lataxe' 206 213 !x.tickname = LABEL_DATE(0, 0,ticknom,_EXTRA = ex) 207 214 !x.ticklen=1. … … 240 247 'x' : begin 241 248 !x.range=[lon1,lon2] 242 !x.tickformat='lonaxe'249 IF key_onearth THEN !x.tickformat='lonaxe' 243 250 END 244 251 'y' : begin … … 259 266 !x.range = sin(!pi/180.*!x.range) 260 267 ENDIF ELSE !x.range=[lat1,lat2] 261 !x.tickformat='lataxe'268 IF key_onearth THEN !x.tickformat='lataxe' 262 269 END 263 270 'z' : begin -
trunk/ToBeReviewed/PLOTS/legende.pro
r41 r42 45 45 pro legende,mi,ma,coupe,CONTOUR = contour,ENDPOINTS = endpoints, DIREC = direc $ 46 46 , VECTLEGENDE = vectlegende $ 47 , INTERVALLE = intervalle, YZ_TYPE = yz_type, VARNAME2 = varname2 $47 , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $ 48 48 , NPTS = npts, _EXTRA = ex 49 49 @common 50 50 tempsun = systime(1) ; pour key_performance 51 51 ;------------------------------------------------------------ 52 grille, mask, glam, gphi, gdep, nx, ny, nz & mask = 1 53 ; 54 ; choose langage 55 ; 56 if n_elements(langage) EQ 0 then langage = 'non definit' 57 CASE langage OF 58 'gb': BEGIN 52 grille, -1, -1, -1, gdep, nx, ny, nz 59 53 ; 60 54 ; English legends 61 55 ; 62 fmt_mm = '(f12.2)' 63 fmt_bt = '(f7.1)' 64 colorf = '' 65 contourf = 'Contour plot,' 66 vecteurf = 'Vector norm ' 67 expf = '' 68 datef = ' ' 69 fieldf = ' ' 70 depthf = ' ' 71 endpointsf = 'Diag. Section' 72 zonalf = '' 73 latintf = 'latitudes in ' 74 timintf = 'time in ' 75 onf = ' - ' 76 depthf2 = 'Depth (m)' 77 Meridf = 'Zonal Mean ' 78 lonintf = 'longitudes in ' 79 hovxt = 'XT-plot ' 80 diaghovxt = 'Diag. XT-plot ' 81 depintf = 'depths in ' 82 timef = 'Time' 83 hovyt = 'YT-plot ' 84 diaghovyt = 'Diag. YT-plot ' 85 hovzt = 'ZT-plot ' 86 hovt = '' 87 END 88 ; 89 ; Legendes en francais 90 ; 91 ELSE: BEGIN 92 fmt_mm = '(f12.2)' 93 fmt_bt = '(f7.1)' 94 colorf = 'Champ en couleur ' 95 contourf = 'Champ en trace noir ' 96 vecteurf = 'Norme vecteur ' 97 expf = 'exp: ' 98 datef = ', date: ' 99 fieldf = ', champ: ' 100 depthf = ', profondeur: ' 101 endpointsf = 'Diag. Section, exp: ' 102 zonalf = 'Coupe Zonale, exp: ' 103 latintf = 'latitude in ' 104 timintf = 'time in ' 105 onf = ' - ' 106 depthf2 = 'Profondeur (m)' 107 meridf = 'Coupe Meridienne, exp: ' 108 lonintf = 'longitude in ' 109 hovxt = 'Trace Longitude-Temps, exp: ' 110 diaghovxt = 'Trace Diag. Longitude-Temps, exp: ' 111 depintf = 'profondeur in ' 112 timef = 'Temps' 113 hovyt = 'Trace Latitude-Temps, exp: ' 114 diaghovyt = 'Trace Diag. Latitude-Temps, exp: ' 115 hovzt = 'Trace Profondeur-Temps, exp: ' 116 hovt = 'Evolution Temporelle, exp: ' 117 END 118 119 ENDCASE 56 fmt_mm = '(f12.2)' 57 fmt_bt = '(f7.1)' 58 colorf = '' 59 contourf = 'Contour plot,' 60 vecteurf = 'Vector norm ' 61 expf = '' 62 datef = ' ' 63 fieldf = ' ' 64 depthf = ' ' 65 endpointsf = 'Diag. Section' 66 zonalf = '' 67 IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in ' 68 timintf = 'time in ' 69 onf = ' - ' 70 depthf2 = 'Depth (m)' 71 Meridf = 'Zonal Mean ' 72 IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in ' 73 hovxt = 'XT-plot ' 74 diaghovxt = 'Diag. XT-plot ' 75 depintf = 'depths in ' 76 timef = 'Time' 77 hovyt = 'YT-plot ' 78 diaghovyt = 'Diag. YT-plot ' 79 hovzt = 'ZT-plot ' 80 hovt = '' 81 IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index' 82 IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index' 83 120 84 vertz = depthf2 121 85 legniv = ' m' 122 IF keyword_set( YZ_TYPE) THEN BEGIN123 IF yz_typeEQ 'hPa' THEN vertz = 'hPa'124 IF yz_typeEQ 'hPa' THEN legniv = ' hPa'86 IF keyword_set(TYPE_YZ) THEN BEGIN 87 IF type_yz EQ 'hPa' THEN vertz = 'hPa' 88 IF type_yz EQ 'hPa' THEN legniv = ' hPa' 125 89 ENDIF 126 90 ; … … 158 122 lo1=strtrim(string(format=fmt_bt, lon1), 2) 159 123 lo2=strtrim(string(format=fmt_bt, lon2), 2) 160 pr1=strtrim(string(format=fmt_bt, prof1), 2)161 pr2=strtrim(string(format=fmt_bt, prof2), 2)124 pr1=strtrim(string(format=fmt_bt, vert1), 2) 125 pr2=strtrim(string(format=fmt_bt, vert2), 2) 162 126 ;------------------------------------------------------------ 163 127 ; gestion de la date … … 173 137 case coupe of 174 138 'xy':begin 175 if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept 176 if n_elements(gdep) GE 2 then begin 177 IF gdep[0] LT gdep[1] THEN niveautest = 1 ELSE niveautest = jpk 178 ENDIF ELSE niveautest = 1 179 if niveau NE niveautest AND (strpos(direc, 'z') EQ -1 OR nz EQ 1) then BEGIN 180 prof=strtrim(round(gdep[niveau-1]), 1) 181 !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 182 ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 183 !x.title = 'Longitude' 184 !y.title = 'Latitude' 139 if strupcase(vargrid) EQ 'W' then firstz = firstzw $ 140 ELSE firstz = firstzt 141 if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN 142 prof = strtrim(round(gdep[0]), 1) 143 !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv 144 ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname 145 !x.title = lontitle 146 !y.title = lattitle 185 147 end 186 148 … … 191 153 !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 192 154 !p.title = zonalf+varexp+datef+svardate+fieldf+varname 193 !x.title = 'Longitude' 194 if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 155 !x.title = lontitle 156 if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 157 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 158 ENDIF 195 159 !y.title = depthf2 196 160 end … … 203 167 !p.title = meridf+varexp+datef+svardate+fieldf+varname 204 168 !y.title = vertz 205 !x.title = 'Latitude' 206 if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 169 !x.title = lattitle 170 if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 171 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 172 ENDIF 207 173 end 208 174 … … 213 179 !p.title = hovxt+varexp+fieldf+varname 214 180 IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef 215 !x.title = 'Longitude' 216 if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 181 !x.title = lontitle 182 if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 183 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 184 ENDIF 217 185 end 218 186 … … 223 191 !p.title = hovyt+varexp+fieldf+varname 224 192 IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef 225 !y.title = 'Latitude' 226 if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 193 !y.title = lattitle 194 if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 195 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 196 ENDIF 227 197 end 228 198 … … 246 216 !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 247 217 !p.title = varexp+datef+svardate+fieldf+varname 248 !x.title = 'Longitude' 249 if keyword_set(endpoints) AND lat1 EQ lat2 then !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) 218 !x.title = lontitle 219 if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN 220 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) 221 ENDIF 250 222 !y.title = varname 251 223 end … … 255 227 !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ 256 228 !p.title = varexp+datef+svardate+fieldf+varname 257 !x.title = 'Latitude' 258 if keyword_set(endpoints) AND lon1 EQ lon2 then !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) 229 !x.title = lattitle 230 if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN 231 IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) 232 ENDIF 259 233 !y.title = varname 260 234 end -
trunk/ToBeReviewed/PLOTS/style.pro
r41 r42 109 109 ; trait continu gras pour 0 110 110 seuil = 1.e-6 111 thick=replicate(. 1, n_elements(level_z2d))111 thick=replicate(.5, n_elements(level_z2d)) 112 112 linestyle=[0] 113 113 rien=where(abs(level_z2d)/max(abs(level_z2d)) LT seuil) 114 if rien[0] NE -1 then thick[rien[0]] = 2114 if rien[0] NE -1 then thick[rien[0]] = 3 115 115 end 116 116 else: begin
Note: See TracChangeset
for help on using the changeset viewer.