- 积分
- 605
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-10-19
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 笑个YY 于 2022-11-15 18:18 编辑
最近NCL读取LU_INDEX变量画土地利用类别图
labelbar色标出来的是数字,想把它变成相应的土地类别,请问怎么做啊
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
a=addfile("geo_em.d03.nc","r")
wks_type = "png"
wks_type@wkWidth = 3000
wks_type@wkHeight = 3000
wks = gsn_open_wks(wks_type,"landuse_21")
gsn_define_colormap(wks,"NCV_roullet")
it=0
land=wrf_user_getvar(a, "LU_INDEX", it)
printVarSummary(land)
land@lat2d=wrf_user_getvar(a, "XLAT_M", it)
land@lon2d=wrf_user_getvar(a, "XLONG_M", it)
printVarSummary(land)
res=True
pltres=True
mpres=True
res@cnFillOn=True
res@cnFillMode="RasterFill"
res@cnLinesOn=False
res@mpDataBaseVersion="MediumRes"
res@mpDataSetName ="Earth..4"
res@cnMinLevelValF=1
res@cnMaxLevelValF=21
res@cnLevelSpacingF=1
res@lbTitleOn =False
res@lbOrientation="vertical"
res@lbLabelOffsetF=0.007
res@pmLabelBarOrthogonalPosF=-1
res@pmLabelBarParallelPosF=1.2
res@lbLabelAlignment="BoxCenters"
res@lbLabelStrings=(/"Evergreen Needleleaf Forest","Evergreen Broadleaf Forest","Deciduous Needleleaf Forest","Deciduous Broadleaf Forest","Mixed Forests","Closed Shrublands","Open Shrublands","Woody Savannas","Savannas","Grasslands","Permanent Wetlands","Croplands","Urban and Built-Up","Cropland/Natural Vegetation Mosic","Snow and Ice","Barren or Sparsely Vegetated","Water","Wooded Tundra","Mixed Tundra","Barren Tundra","Lake"/)
mpres@mpNationalLineColor= "Black"
mpres@mpOutlineBoundarySets="AllBoundaries"
resParam=res
resParam@cnFillOn=True
counter=wrf_contour(a, wks, land, resParam)
plot=wrf_map_overlays(a, wks, (/counter/), pltres, mpres)
end
|
-
-
|