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