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