好看的地形与不好看的地形
1、不好看但精准的地形
利用地形数据,低于地形的地方填色
优点:精确
缺点:使用不同分辨率数据时,需要进行调整
function read_height_data(topo_file)
local nlat,nlon,topo_file,lat,lon
begin
nlat = 2160
nlon = 4320
setfileoption("bin","ReadByteOrder","BigEndian")
elev = tofloat(cbinread(topo_file,(/nlat,nlon/),"short"))
lat = fspan(90,-90,nlat)
lon = fspan(0,360,nlon)
lat!0 = "lat"
lon!0 = "lon"
lat@units = "degrees_north"
lon@units = "degrees_east"
lat&lat = lat
lon&lon = lon
elev!0 = "lat"
elev!1 = "lon"
elev&lat = lat
elev&lon = lon
return(elev)
end
;; Read terrain data from a C binary file
elev = read_height_data("ETOPO5.DAT")
;; Convert terrain data from units "m" to "hPa", it is described as a high pressure formula
elev = 1013.25*(1-elev*0.0065/288.15)^5.25145
;; The purpose of the interpolation is to make terrain data and variable data have the same resolution
lat = fspan(-90,90,73)
lon = fspan(lon_1,lon_2,toint((lon_2-lon_1)/2.5+1))
geog = area_hi2lores_Wrap(elev&lon,elev&lat,elev,True,1,lon,lat,False)
geogsection = geog({stdlat},:)
; geogsection = geog(:,{stdlon})
;; Determine the terrain
topo2d = conform(temp,geogsection,1)
high2d = conform(temp,temp&lev,0)
tMask= temp
; tMask@_FillValue = 99999
tMask = (/mask(temp,topo2d.lt.high2d,False)/)
plot = gsn_csm_pres_hgt(wks, tMask, res )
2、好看的地形
利用地形数据画出地形后直接overlay在原图上。
优点:简单易操作,不受数据分辨率影响
缺点:
dixing = gsn_csm_pres_hgt(wks,dx({levb:levt},{lat_3},{lon_1:lon_2}),resa)
plot = gsn_csm_pres_hgt(wks, temp({levb:levt},:), res)
overlay(plot,dixing)