- 积分
- 1319
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-1-7
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请各位大神帮忙看看:
我用NCL读取micaps第四类数据(二进制文件)的图,图和地图总是不匹配,请教下各位大神是什么原因(有点怀疑是onedtond函数用的不对,但只是怀疑)?超级感谢
以下是我的NCL程序:(图和数据在附件)
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
aaa="/cygdrive/y/shanghai_warr/rain_1/2020060406.001"
mdata = asciiread(aaa,-1,"float")
;delete(mdata)
nlat = 1176
nlon = 1041
lon = fspan(106.61,135.99,nlon);fspan(开始,结束,个数),等间距扩展一列数
lat = fspan(17.38, 43.38,nlat)
lon2d = onedtond(lon,(/nlat,nlon/));将lon从一维扩展到多维(nlat,nlon)
lat2d = onedtond(lat,(/nlat,nlon/));
shk2d = onedtond(mdata(23::1),(/nlat,nlon/));读数据从第四行读到最后,数据先排一列再排一行
shk2d!0="lat"
shk2d!1="lon"
shk2d&lat = lat
shk2d&lon = lon
shk2d&lat@units="degrees_north"
shk2d&lon@units="degrees_east"
;;;
wks = gsn_open_wks("eps","./te")
gsn_define_colormap(wks,"temp_diff_18lev")
plot=new(1,graphic);将4个图形存为一个数组
res = True
res@gsnDraw = False
res@gsnFrame = False
;res@gsnDraw = True
res@gsnMaximize = True
res@cnFillOn = True
res@cnLinesOn = False
res@gsnAddCyclic = False
res@mpFillOn = False
res@mpLimitMode = "LatLon"
res@mpMinLatF = 28
res@mpMaxLatF = 37
res@mpMinLonF = 112
res@mpMaxLonF = 122
; res@mpGridAndLimbOn = True
res@mpGridLineDashPattern = 5
res@mpGridSpacingF = 5
res@mpDataSetName = "Earth..4"
res@mpDataBaseVersion = "MediumRes"
res@mpOutlineSpecifiers = (/"China:states"/)
res@mpUSStateLineThicknessF = 2
res@mpUSStateLineColor = "Black"
plot = gsn_csm_contour_map(wks, shk2d,res)
;resk = True
;gsn_panel(wks,plot,(/1,1/),resk)
printVarSummary(shk2d)
draw(plot)
frame(wks)
end
|
|