[85] | 1 | pro map_uvt |
---|
| 2 | ; |
---|
| 3 | ; |
---|
| 4 | ; |
---|
| 5 | what_I_plot=0. |
---|
| 6 | overcontour=0 |
---|
| 7 | no3d='true' |
---|
| 8 | @map_uvt_inc.pro |
---|
| 9 | SPAWN, '\rm param_plot.idl ; cp map_uvt_inc.pro param_plot.idl ; cp -f map_uvt_inc.pro '+save_ps+'.map_uvt_inc.pro' |
---|
| 10 | if (n_elements(coord2d) eq 0) then coord2d='false' |
---|
[95] | 11 | if (n_elements(overvector_x) eq 0) then overvector_x = 1 ;; initialisation (!! map_uvt_inc.pro utilise dans map_uvt et map_latlon) |
---|
[85] | 12 | ; |
---|
| 13 | ; |
---|
| 14 | ; |
---|
| 15 | if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1 |
---|
[91] | 16 | if (n_elements(field2) ne 0) then getcdf, file=filename, charvar=field2, invar=cfield2 |
---|
[95] | 17 | if ( ( overvector_x ne 0 ) or ( n_elements(field1) eq 0 ) ) then begin |
---|
| 18 | u = getget(filename, 'Um', count=[0,0,1,0], offset=[0,0,nlevel,0]) |
---|
| 19 | v = getget(filename, 'Vm', count=[0,0,1,0], offset=[0,0,nlevel,0]) |
---|
| 20 | help, u |
---|
[86] | 21 | endif |
---|
[160] | 22 | if (n_elements(fieldscoord) eq 0) then begin |
---|
| 23 | getcdf, file=filename, charvar='XLONG', invar=longi |
---|
| 24 | getcdf, file=filename, charvar='XLAT', invar=lati |
---|
| 25 | getcdf, file=filename, charvar='HGT', invar=hgt |
---|
| 26 | endif else begin |
---|
| 27 | print, 'coordinates are ', fieldscoord |
---|
| 28 | getcdf, file=filename, charvar=fieldscoord(0), invar=longi |
---|
| 29 | getcdf, file=filename, charvar=fieldscoord(1), invar=lati |
---|
| 30 | getcdf, file=filename, charvar=fieldscoord(2), invar=hgt |
---|
| 31 | endelse |
---|
| 32 | |
---|
[91] | 33 | ; |
---|
| 34 | ; |
---|
| 35 | ; |
---|
[85] | 36 | sp = 5 ;; relaxation width |
---|
| 37 | nx = n_elements(longi(0,*)) |
---|
| 38 | ny = n_elements(longi(*,0)) |
---|
| 39 | if (n_elements(field1) ne 0) then begin |
---|
| 40 | if (no3d ne 'true') then cfield1 = cfield1 (sp:nx-sp-1,sp:ny-sp-1,*,*) else cfield1 = cfield1 (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 41 | endif |
---|
[91] | 42 | if (n_elements(field2) ne 0) then begin |
---|
| 43 | if (no3d ne 'true') then cfield2 = cfield2 (sp:nx-sp-1,sp:ny-sp-1,*,*) else cfield2 = cfield2 (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 44 | endif |
---|
[95] | 45 | if ( ( overvector_x ne 0 ) or ( n_elements(field1) eq 0 ) ) then begin |
---|
| 46 | u = reform (u (sp:nx-sp-1,sp:ny-sp-1,0,*) ) |
---|
| 47 | v = reform (v (sp:nx-sp-1,sp:ny-sp-1,0,*) ) |
---|
[86] | 48 | endif |
---|
[85] | 49 | longi = longi (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 50 | lati = lati (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 51 | hgt = hgt (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
[91] | 52 | nx = n_elements(longi(*,0,0)) |
---|
| 53 | ny = n_elements(longi(0,*,0)) |
---|
| 54 | nt = n_elements(longi(0,0,*)) |
---|
[95] | 55 | if ( overvector_x ne 0 ) then begin |
---|
[91] | 56 | overvector_x = u |
---|
| 57 | overvector_y = v |
---|
| 58 | endif |
---|
[85] | 59 | ; |
---|
| 60 | ; |
---|
| 61 | ; |
---|
[91] | 62 | if (ntime eq 99) then begin |
---|
| 63 | PRINT, '-- ALL TIME STEPS', nt-1 |
---|
| 64 | ntstart = 0 & ntend = nt-1 |
---|
| 65 | endif else begin |
---|
| 66 | PRINT, '-- ONLY TIME STEP ', string(ntime,'(I0)') |
---|
| 67 | ntstart = ntime & ntend = ntime |
---|
| 68 | endelse |
---|
| 69 | for ntime = ntstart,ntend do begin |
---|
[95] | 70 | help, u |
---|
[91] | 71 | ; |
---|
| 72 | ; |
---|
| 73 | ; |
---|
| 74 | zefile=save_ps+string(100+ntime,'(I0)') |
---|
| 75 | PS_Start, filename=zefile+'.ps' |
---|
| 76 | print, zefile+'.ps' |
---|
| 77 | !P.Charsize = 1.2 |
---|
| 78 | !p.charthick = 2.0 |
---|
| 79 | !p.thick = 2.0 |
---|
| 80 | !x.thick = 2.0 |
---|
| 81 | !y.thick = 2.0 |
---|
| 82 | ; |
---|
| 83 | ; |
---|
| 84 | ; |
---|
[85] | 85 | lon = reform(longi(*,*,ntime)) |
---|
| 86 | lat = reform(lati(*,*,ntime)) |
---|
| 87 | if (n_elements(field1) eq 0) then begin |
---|
| 88 | print, 'field1: horizontal velocity' |
---|
[96] | 89 | ;;;attention attention overvector_x et overvector_y sont vides |
---|
| 90 | ;zevel = overvector_x^2 + overvector_y^2 ;; attention il faut que les tableaux soient de la meme taille, OK si uvmet |
---|
| 91 | zevel = (reform(u(*,*,ntime)))^2 + (reform(v(*,*,ntime)))^2 ;; attention il faut que les tableaux soient de la meme taille, OK si uvmet |
---|
[85] | 92 | what_I_plot = sqrt(zevel) |
---|
| 93 | endif else begin |
---|
| 94 | if (no3d ne 'true') then what_I_plot = reform(cfield1(*,*,nlevel,ntime)) else what_I_plot = reform(cfield1(*,*,ntime)) |
---|
[95] | 95 | if (n_elements(u) ne 0) then overvector_x = reform(u(*,*,ntime)) ;; ne pas utiliser test overvector_x a cause de la boucle temps |
---|
| 96 | if (n_elements(v) ne 0) then overvector_y = reform(v(*,*,ntime)) ;; ne pas utiliser test overvector_y a cause de la boucle temps |
---|
[85] | 97 | endelse |
---|
[91] | 98 | if (n_elements(field2) eq 0) then begin |
---|
| 99 | print, 'field2: topography' |
---|
| 100 | overcontour = reform(hgt(*,*,ntime)) |
---|
| 101 | endif else begin |
---|
| 102 | if (no3d ne 'true') then overcontour = reform(cfield2(*,*,nlevel,ntime)) else overcontour = reform(cfield2(*,*,ntime)) |
---|
| 103 | endelse |
---|
[85] | 104 | ; |
---|
| 105 | ; |
---|
| 106 | ; |
---|
[91] | 107 | if ( coord2d eq 'polar' ) then begin |
---|
| 108 | print, 'OK YOU USE MAP_SET with POLAR PROJECTION. VECTORS ARE NOT SUPPORTED. USE polar_uv OR ADAPT THIS SCRIPT.' |
---|
| 109 | overvector_x = 0 |
---|
| 110 | overvector_y = 0 |
---|
| 111 | if (n_elements(windowx) ne 0) then begin |
---|
| 112 | latmin = windowy(0) & latmax = windowy(1) & lonmin = windowx(0) & lonmax = windowx(1) |
---|
| 113 | endif else begin |
---|
| 114 | latmin = 65. & latmax = 90. & lonmin = -180. & lonmax = 180. |
---|
| 115 | endelse |
---|
| 116 | print, 'latmin,lonmin,latmax,lonmax', latmin,lonmin,latmax,lonmax |
---|
| 117 | map_set, latmax, 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax], title=title_user, /advance |
---|
| 118 | endif else begin |
---|
| 119 | minlat=min(lat) & maxlat=max(lat) & minlon=min(lon) & maxlon=max(lon) |
---|
| 120 | if (coord2d eq 'true') then begin |
---|
[95] | 121 | ;;;; CECI EST DESORMAIS FAIT DANS MAP_LATLON |
---|
| 122 | ;;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*)) ;; trop de points, mais au moins on ne perd rien |
---|
| 123 | ;;TRIANGULATE, lon, lat, tr |
---|
| 124 | ;;what_I_plot = GRIDDATA( lon, lat, what_I_plot, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 125 | ;;if ( overvector_x ne 0 ) then begin |
---|
| 126 | ;; overvector_x = GRIDDATA( lon, lat, overvector_x, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 127 | ;; overvector_y = GRIDDATA( lon, lat, overvector_y, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 128 | ;;endif |
---|
| 129 | ;;overcontour = GRIDDATA( lon, lat, overcontour, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 130 | ;; if ( overvector_x ne 0 ) then begin |
---|
| 131 | ;; ; sale sale sale |
---|
| 132 | ;; if (minlat lt min(lat(*,0))) then overvector_y=-overvector_y |
---|
| 133 | ;; if (minlon lt min(lon(0,*))) then overvector_x=-overvector_x |
---|
| 134 | ;; endif |
---|
| 135 | ;;lon = minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1) |
---|
| 136 | ;;lat = minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1) |
---|
[91] | 137 | endif else begin |
---|
[85] | 138 | lon = reform(lon(*,0)) |
---|
| 139 | lat = reform(lat(0,*)) |
---|
[95] | 140 | ;;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*)) |
---|
| 141 | ;;what_I_plot = REBIN( what_I_plot, npoints, npoints ) |
---|
| 142 | ;;overvector_x = REBIN( overvector_x, npoints, npoints ) |
---|
| 143 | ;;overvector_y = REBIN( overvector_y, npoints, npoints ) |
---|
| 144 | ;;overcontour = REBIN( overcontour, npoints, npoints ) |
---|
| 145 | ;;lon = minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1) |
---|
| 146 | ;;lat = minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1) |
---|
| 147 | ;lon = findgen( n_elements(what_I_plot(*,0)) ) |
---|
| 148 | ;lat = findgen( n_elements(what_I_plot(0,*)) ) |
---|
| 149 | ;print, 'ATTENTION!!!! NOUS SOMMES BIEN D ACCORD QUE VOUS NE CHARGEZ PAS UMET et VMET ??' |
---|
[91] | 150 | endelse |
---|
[95] | 151 | ;;;;; trouve dans polar_uv.pro |
---|
| 152 | ;;if (coord2d eq 'regular') then begin ;; carte avec mercator |
---|
| 153 | ;; lon = reform(lon(*,0)) |
---|
| 154 | ;; lat = reform(lat(0,*)) |
---|
| 155 | ;;endif |
---|
[85] | 156 | endelse |
---|
| 157 | help, what_I_plot, lon, lat |
---|
[131] | 158 | print, 'COLOR PLOT min/max ', min(what_I_plot), max(what_I_plot) |
---|
| 159 | print, 'CONTOUR PLOT min/max ', min(overcontour), max(overcontour) |
---|
| 160 | print, 'VECTOR PLOT min/max ', min(overvector_x), min(overvector_y) |
---|
[85] | 161 | ; |
---|
| 162 | ; |
---|
| 163 | ; |
---|
| 164 | map_latlon, $ |
---|
| 165 | what_I_plot, $ ; 2D field |
---|
| 166 | lon, $ ; 1D latitude |
---|
| 167 | lat, $ ; 1D longitude |
---|
| 168 | minfield=minfield_init, $ ; minimum value of plotted field (=0: calculate) |
---|
| 169 | maxfield=maxfield_init, $ ; maximum value of plotted field (=0: calculate) |
---|
| 170 | overcontour=overcontour, $ ; another 2D field to overplot with contour lines (=0: no) |
---|
| 171 | overvector_x=overvector_x, $ ; wind vector - x component (=0: no) |
---|
| 172 | overvector_y=overvector_y, $ ; wind vector - y component (=0: no) |
---|
| 173 | ct=pal, $ ; color table (33-rainbow is default) |
---|
| 174 | colors=colors, $ ; number of colors/levels (32 is default) |
---|
| 175 | title=title_user, $ ; title of the plot ('' is default) |
---|
| 176 | format=format ; format of colorbar annotations ('(F6.2)' is default) |
---|
| 177 | ; |
---|
| 178 | ; |
---|
| 179 | ; |
---|
[91] | 180 | if ( coord2d eq 'polar' ) then begin ;;; pourrait aller dans map_latlon |
---|
| 181 | loadct, 0 |
---|
| 182 | MAP_GRID, $ |
---|
| 183 | CHARSIZE = 1., $ |
---|
| 184 | COLOR = 0, $ |
---|
| 185 | ;lats=-60, $ |
---|
| 186 | LABEL = 1, $ ;; /LABEL or LABEL=2 (one label any 2 grid lines) |
---|
| 187 | LATDEL = intervaly, $ ;;5 10 |
---|
| 188 | LONDEL = intervalx, $ ;;15 |
---|
[154] | 189 | ;LONLAB = latmin + intervaly/2., $ ;5. + (latmin+latmax)/2., $ ;0. |
---|
| 190 | LONLAB = (latmin+latmax)/2., $ |
---|
[91] | 191 | LATLAB = -0.001, $ |
---|
| 192 | GLINESTYLE = 2, $ |
---|
| 193 | GLINETHICK = 0.3 |
---|
| 194 | ;LONALIGN = 0., $ |
---|
| 195 | ;LATALIGN = 1. |
---|
| 196 | endif |
---|
| 197 | ; |
---|
| 198 | ; |
---|
| 199 | ; |
---|
[85] | 200 | PS_End, /PNG |
---|
[91] | 201 | endfor |
---|
[85] | 202 | end |
---|