[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 | zefile=save_ps |
---|
| 15 | PS_Start, filename=zefile+'.ps' |
---|
| 16 | print, zefile+'.ps' |
---|
| 17 | !P.Charsize = 1.2 |
---|
| 18 | !p.charthick = 2.0 |
---|
| 19 | !p.thick = 2.0 |
---|
| 20 | !x.thick = 2.0 |
---|
| 21 | !y.thick = 2.0 |
---|
| 22 | ; |
---|
| 23 | ; |
---|
| 24 | ; |
---|
| 25 | if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1 |
---|
[86] | 26 | if ( (n_elements(overvector_x) ne 0) or (n_elements(field1) eq 0) ) then begin |
---|
| 27 | u = getget(filename, 'Um', count=[0,0,1,1], offset=[0,0,nlevel,ntime]) |
---|
| 28 | v = getget(filename, 'Vm', count=[0,0,1,1], offset=[0,0,nlevel,ntime]) |
---|
| 29 | endif |
---|
[85] | 30 | getcdf, file=filename, charvar='XLONG', invar=longi |
---|
| 31 | getcdf, file=filename, charvar='XLAT', invar=lati |
---|
| 32 | getcdf, file=filename, charvar='HGT', invar=hgt |
---|
| 33 | ;; |
---|
| 34 | ;; |
---|
| 35 | ;; |
---|
| 36 | ; hgt = smooth(hgt, [2,2,0], /EDGE_TRUNCATE) ;;; truc |
---|
| 37 | ;; |
---|
| 38 | ;; |
---|
| 39 | ;; |
---|
| 40 | sp = 5 ;; relaxation width |
---|
| 41 | nx = n_elements(longi(0,*)) |
---|
| 42 | ny = n_elements(longi(*,0)) |
---|
| 43 | if (n_elements(field1) ne 0) then begin |
---|
| 44 | 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,*) |
---|
| 45 | endif |
---|
[86] | 46 | if ( (n_elements(overvector_x) ne 0) or (n_elements(field1) eq 0) ) then begin |
---|
| 47 | u = u (sp:nx-sp-1,sp:ny-sp-1);,*,*) |
---|
| 48 | v = v (sp:nx-sp-1,sp:ny-sp-1);,*,*) |
---|
| 49 | endif |
---|
[85] | 50 | longi = longi (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 51 | lati = lati (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 52 | hgt = hgt (sp:nx-sp-1,sp:ny-sp-1,*) |
---|
| 53 | nx = n_elements(longi(*,0)) |
---|
| 54 | ny = n_elements(longi(0,*)) |
---|
| 55 | ; |
---|
| 56 | ; |
---|
| 57 | ; |
---|
| 58 | overcontour = reform(hgt(*,*,ntime)) |
---|
| 59 | lon = reform(longi(*,*,ntime)) |
---|
| 60 | lat = reform(lati(*,*,ntime)) |
---|
[86] | 61 | if (n_elements(overvector_x) ne 0) then begin |
---|
| 62 | overvector_x = u;reform(u(*,*,nlevel,ntime)) |
---|
| 63 | overvector_y = v;reform(v(*,*,nlevel,ntime)) |
---|
| 64 | endif |
---|
[85] | 65 | if (n_elements(field1) eq 0) then begin |
---|
| 66 | print, 'field1: horizontal velocity' |
---|
| 67 | zevel = overvector_x^2 + overvector_y^2 ;; attention il faut que les tableaux soient de la meme taille, OK si uvmet |
---|
| 68 | what_I_plot = sqrt(zevel) |
---|
| 69 | endif else begin |
---|
| 70 | if (no3d ne 'true') then what_I_plot = reform(cfield1(*,*,nlevel,ntime)) else what_I_plot = reform(cfield1(*,*,ntime)) |
---|
| 71 | endelse |
---|
| 72 | ; |
---|
| 73 | ; |
---|
| 74 | ; |
---|
| 75 | minlat=min(lat) & maxlat=max(lat) & minlon=min(lon) & maxlon=max(lon) |
---|
| 76 | if (coord2d eq 'true') then begin |
---|
| 77 | npoints=n_elements(lon(*,0)) + n_elements(lon(0,*)) ;; trop de points, mais au moins on ne perd rien |
---|
| 78 | TRIANGULATE, lon, lat, tr |
---|
| 79 | what_I_plot = GRIDDATA( lon, lat, what_I_plot, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 80 | overvector_x = GRIDDATA( lon, lat, overvector_x, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 81 | overvector_y = GRIDDATA( lon, lat, overvector_y, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 82 | overcontour = GRIDDATA( lon, lat, overcontour, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN ) |
---|
| 83 | ; sale sale sale |
---|
| 84 | if (minlat lt min(lat(*,0))) then overvector_y=-overvector_y |
---|
| 85 | if (minlon lt min(lon(0,*))) then overvector_x=-overvector_x |
---|
| 86 | lon = minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1) |
---|
| 87 | lat = minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1) |
---|
| 88 | endif else begin |
---|
| 89 | lon = reform(lon(*,0)) |
---|
| 90 | lat = reform(lat(0,*)) |
---|
| 91 | ;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*)) |
---|
| 92 | ;what_I_plot = REBIN( what_I_plot, npoints, npoints ) |
---|
| 93 | ;overvector_x = REBIN( overvector_x, npoints, npoints ) |
---|
| 94 | ;overvector_y = REBIN( overvector_y, npoints, npoints ) |
---|
| 95 | ;overcontour = REBIN( overcontour, npoints, npoints ) |
---|
| 96 | ;lon = minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1) |
---|
| 97 | ;lat = minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1) |
---|
| 98 | endelse |
---|
| 99 | help, what_I_plot, lon, lat |
---|
| 100 | print, min(what_I_plot) |
---|
| 101 | print, max(what_I_plot) |
---|
| 102 | ; |
---|
| 103 | ; |
---|
| 104 | ; |
---|
| 105 | map_latlon, $ |
---|
| 106 | what_I_plot, $ ; 2D field |
---|
| 107 | lon, $ ; 1D latitude |
---|
| 108 | lat, $ ; 1D longitude |
---|
| 109 | minfield=minfield_init, $ ; minimum value of plotted field (=0: calculate) |
---|
| 110 | maxfield=maxfield_init, $ ; maximum value of plotted field (=0: calculate) |
---|
| 111 | overcontour=overcontour, $ ; another 2D field to overplot with contour lines (=0: no) |
---|
| 112 | overvector_x=overvector_x, $ ; wind vector - x component (=0: no) |
---|
| 113 | overvector_y=overvector_y, $ ; wind vector - y component (=0: no) |
---|
| 114 | ct=pal, $ ; color table (33-rainbow is default) |
---|
| 115 | colors=colors, $ ; number of colors/levels (32 is default) |
---|
| 116 | title=title_user, $ ; title of the plot ('' is default) |
---|
| 117 | format=format ; format of colorbar annotations ('(F6.2)' is default) |
---|
| 118 | ; |
---|
| 119 | ; |
---|
| 120 | ; |
---|
| 121 | PS_End, /PNG |
---|
| 122 | end |
---|