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

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
NCL读取csv格式数据后,无法画出浓度分布图,图上无数据,一直找不到原因。
图像空白如下:
脚本如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
alat = asciiread("./latitude1.csv",-1,"float")
alon = asciiread("./longitude1.csv",-1,"float")
data = asciiread("./c1.csv",-1,"float")
lat = latGlobeFo(140,"lat","latitude","degrees_north")
lon = lonGlobeFo(140,"lon","lonitude","degrees_east")
lat!0 ="a"
lon!0 ="b"
lat&a = alat
lon&b = alon
c = new((/140,140/),float,-9999)
do it=0,dimsizes(alat)-1,1
c(it,it)=data(it)
c@_FillValue = -9999
end do
c!0 = "olat"
c!1 = "olon"
c&olat = lat
c&olon = lon
c@units = "ppmv"
c&olat@units = "degrees_north"
c&olon@units = "degrees_east"
;print(c(1,1))
printVarSummary(c)
wks = gsn_open_wks ("png", "Annual_Observed" ) ; send graphics to PNG file
gsn_define_colormap(wks,"hotcolr_19lev")
res = True ; plot mods desired
res@tiMainString = "Annual CO2 distribution (observed) " ;-- draw a title
res@pmTickMarkDisplayMode = "Always"
res@gsnMaximize = True
res@gsnDraw = True ; don't draw
res@gsnFrame = False ; don't advance frame
res@gsnAddCyclic = False
res@trGridType = "TriangularMesh"
res@lbLabelBarOn = True
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = 282.1 ; set min contour level
res@cnMaxLevelValF = 400 ; set max contour level
res@cnLevelSpacingF = 5
res@cnLineThicknessF = 5 ;-- make lines thicker
res@cnMonoLineColor = True ;-- use multiple line colors
res@cnLevelSpacingF = 5 ;-- contour level spacin
res@cnLineLabelsOn = True ; turn on line labels
res@cnFillOn = True ; turn on color
res@cnInfoLabelOn = True
res@mpCenterLonF = 0 ; center plot at 0
res@mpMinLatF = -90
res@mpMaxLatF = 90
res@mpMinLonF = 0 ; select a subregion
res@mpMaxLonF = 358.75
;---Using the color map to define colors for contours or vectors
res@cnFillPalette = "hotcolr_19lev"
;---Reading the colormap into an N x 4 (RGBA) array
cmap = read_colormap_file("hotcolr_19lev")
plot=gsn_csm_contour_map(wks,c,res)
draw(plot)
frame(wks)
end
拜托大家帮我找一下原因
|
|