- 积分
- 19010
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-6-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 ljlhx2016 于 2016-7-28 19:40 编辑
数据是txt格式的,数据内容是一个domain各网格的值,这些值只有3类:111、121、-9999。一共3000*5000个网格。
对应的经纬度可以算出来,怎么把这3类值在这个domain上面画出来,求大神指导 代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
fil = "~/mine/data/irriland.txt"
head = readAsciiHead(fil,6)
print(head)
nlon = 6157
nlat = 3393
xllcorner = 66.292299724777
yllcorner = 14.996703348654
cellsize = 0.011783626620396
clon = 103.0
clat = 35.0
NODATA_value = -9999
data = readAsciiTable(fil,nlon,"float",(/6,0/))
printVarSummary(data)
lucc = data(::-1,:) ; flip the data in latitude if needed
lat = fspan(yllcorner,yllcorner + 3392 * cellsize,3393)
lon = fspan(xllcorner,xllcorner + 6156 * cellsize,6157)
lat2 = onedtond(lat,(/6157,3393/))
lon2 = onedtond(lon,(/3393,6157/))
; lat2@units = "degrees_north"
; lon2@units = "degrees_east"
wks = gsn_open_wks("x11","~/irriland")
res = True
res@cnFillOn = True
; res@cnLevelSelectionMode = "ExplicitLevels"
; res@cnLevels = (/110,120/)
; res@cnFillColors = (/"White","Green","Red"/)
res@pmTickMarkDisplayMode = "Always"
res@tiMainString = "Cropland of China"
res@gsnAddCyclic = False
res@mpProjection = "Stereographic"
res@mpLimitMode = "Corners"
res@mpLeftCornerLatF = lat2(0,0)
res@mpLeftCornerLonF = lon2(0,0)
res@mpRightCornerLatF = lat2(nlon-1,nlat-1)
res@mpRightCornerLonF = lon2(nlat-1,nlon-1)
res@mpRelativeCenterLon = True
res@mpCenterLonF = clon
res@mpRelativeCenterLat = True
res@mpCenterLatF = clat
res@tfDoNDCOverlay = True
;---------------Increase the maximum workspace memory----------------
setvalues NhlGetWorkspaceObjectId()
"wsMaximumSize" : 600000000
end setvalues
plot = gsn_csm_contour_map(wks,lucc,res)
end
这是生成的图片,求大神指导问题出在哪里
生成的图片
|
|