- 积分
- 4814
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-18
- 最后登录
- 1970-1-1
|
发表于 2023-3-31 12:21:27
|
显示全部楼层
你好,我想请教下我想mask中国地区的数据,用的是wrf模式的wrfout模拟结果,但是绘图整体偏移了,我想大概是wrf模式的投影是兰波托投影,用于mask的shp是地理经纬度的缘故,我试着把shp也定义为兰波托投影,但是还是一样的,但是不知道怎们修改,你有空可以帮忙看下吗
load"./shapefile_utils.ncl"
begin
a = addfile("/data/wrfout/wrfout_huodian/wrfout_d01_2020-01-01_00:00:00"+".nc","r")
tc2 = wrf_user_getvar(a,"T2",0) ; T2 in Kelvin
tc2 = tc2-273.16
tc2@units = "~F35~J~F~C"
printVarSummary(tc2)
xlat = a->XLAT(0,:,0)
xlon = a->XLONG(0,0,:)
mask_data = tc2
mask_data!0 = "lat"
mask_data!1 = "lon"
mask_data&lat = xlat
mask_data&lon = xlon
shp_file = "/data/wrfout/map/Province_9.shp"
tes = True
tes@return_mask = True
land_mask = shapefile_mask_data(mask_data,shp_file,tes)
land_mask_cg = where(land_mask .eq. 1,tc2,tc2@_FillValue)
type = "png"
wks = gsn_open_wks(type,"t2_test01")
gsn_define_colormap(wks,"Rainbow")
res = True
;;plot
cnres = res
cnres@cnFillOn = True
cnres@cnLinesOn = False
cnres@gsnLeftString = " "
cnres@gsnRightString = ""
contour_tc = gsn_csm_contour(wks,land_mask_cg,cnres)
pltres = True ; Basic overlay plot options
pltres@PanelPlot = True ; Tells wrf_map_overlays not to remove overlays
mpres = True ; Set map options
mpres@mpOutlineOn = False ; Turn off map outlines
mpres@mpFillOn = False ; Turn off map fill
plot = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres)
shp_name = "/data/wrfout/map/Province_9.shp"
lnres = True
lnres@gsLineColor = "black"
lnres@gsLineThicknessF = 8.0
cz_id = gsn_add_shapefile_polylines(wks,plot,shp_name,lnres)
draw(plot) ; This will draw the map and the shapefile outlines.
frame(wks) ; Advance the frame
end
|
-
|