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