- 积分
- 19312
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-12-1
- 最后登录
- 1970-1-1
|
发表于 2017-5-9 10:48:24
|
显示全部楼层
从你这个图上看,经纬度信息好像是没赋好,我自己简单画了下,你看看是不是有帮助。(1)
begin
a = addfile("wrfout_d01_2010-10-14_00:00:00","r")
lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)
tt = wrf_user_getvar(a,"T2",0)
tt@lat2d = lat2d
tt@lon2d = lon2d
wks = gsn_open_wks("pdf","sp_tmp")
res = True
res@gsnDraw = True
res@gsnMaximize = True
res@cnFillOn = True
res@cnLinesOn = False
res@gsnAddCyclic = False
plot = gsn_csm_contour_map(wks,tt,res)
end
得到的图如下:
模拟区域只有南海和西北太这么大的区域,并且是兰勃脱投影,底图是经纬网格,所以画出来模拟区域的数据是扇形。
(2)
接下来我把 tt@lat2d = lat2d
tt@lon2d = lon2d这两句注释掉,得到如下图:
变量没了坐标信息,因此自动填充了整个画图区域,并且在运行ncl脚本时,会提示:
(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't
contain one at all.(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N'
'degreeN' 'degreesN' 'deg north'(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't
contain one at all.(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'deg
reeE' 'degreesE' 'deg east'
(3)
接下来插值到经纬网格上去
begin
a = addfile("wrfout_d01_2010-10-14_00:00:00","r")
lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)
lat1d = lat2d(:,0)
lon1d = lon2d(0,:)
tt = wrf_user_getvar(a,"T2",0)
tt@lat2d = lat2d
tt@lon2d = lon2d
tt2 = rcm2rgrid_Wrap(lat2d,lon2d,tt,lat1d,lon1d,0)
wks = gsn_open_wks("pdf","sp_tmp")
res = True
res@gsnDraw = True
res@gsnMaximize = True
res@cnFillOn = True
res@cnLinesOn = False
res@gsnAddCyclic = False
plot = gsn_csm_contour_map(wks,tt2,res)
end
得到如下图:
小区域内已经变成直角矩形
(4)
修改底图范围:
res@mpMinLatF = min(lat1d)
res@mpMaxLatF = max(lat1d)
res@mpMinLonF = min(lon1d)
res@mpMaxLonF = max(lon1d)
得到如下图:
最下头的空白是因为,原始数据是兰勃脱投影,最下边是向上拱起来的,空白部分没有数据,因此插值出来也是缺省值,在插值时把lat1d的范围略调小,就可以解决。
|
评分
-
查看全部评分
|