- 积分
- 8280
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-3-11
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
为什么叠加中国地图,等值线填色图就错位了,单独画填色图就是对的,这是怎么回事儿啊!
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
data = asciiread("jieguo5.txt",-1,"float")
;printVarSummary(data)
argu = onedtond(data, (/2440,13/))
hgt = argu(:,3)
lat=argu(:,2)
lon=argu(:,1)
;print(argu)
;argu = asciiread("jieguo.txt",-1,"string") ;以字符串形式读取参数文件入数组argu
;lines = asciiread(argu(2)+argu(3),-1,"string") ;以字符串形式读取数据文件入数组 lines
;station = stringtofloat(str_get_field(argu,1," ")) ;从数组lines中获取站号
;lon = stringtofloat(str_get_field(argu,2," ")) ;从数组lines中获取经度值lon
;lat = stringtofloat(str_get_field(argu,3," ")) ;从数组lines中获取纬度值lat
;h = stringtofloat(str_get_field(argu,4," ")) ;从数组lines中获取海拔高度
;R = stringtofloat(str_get_field(lines(3::),5," ")) ;从数组lines中获取站点数据值
;printMinMax(lat,False)
;printMinMax(lon,False)
;print(h(0:10))
;printVarSummary(argu)
;print(argu(0:1,:))
olon = fspan(75,135,200)
olat = fspan(16,54,200)
data1 = new((/200,200/),"float")
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degrees-east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degrees_north"
olat&lat = olat
;print(olat)
hgt@_FillValue = 999999.000000
rscan = (/10,5,3/) ;连续的有效半径大小,最大为10,依次递减
datahgt = obj_anal_ic_deprecated(lon,lat,hgt,olon,olat,rscan,False)
;print(datahgt)
; Assign named dimensions
data1!0 = "lon"
data1!1 = "lat"
; Assign coordinate variables
data1&lon = olon
data1&lat = olat
;printVarSummary(data1)
;print(data1(10:15,100:104))
;printMinMax(data1,False)
wks = gsn_open_wks ("png","hgt") ; "xy2a.ps"
;gsn_define_colormap(wks,"gui_default")
gsn_define_colormap( wks ,"gui_default")
res = True
res@tiMainString ="hgt"
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;>--------------------------------------------<
; set for the map
;>--------------------------------------------<
res@mpMinLatF = 17.
res@mpMaxLatF = 55.
res@mpMinLonF = 72.
res@mpMaxLonF = 136.
res@mpFillOn = True
res@mpOutlineOn = False ; Use outlines from shapefile
res@cnFillDrawOrder = "PreDraw"
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"China","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpOutlineBoundarySets = "NoBoundaries"
;>--------------------------------------------<
; set for the plot
res@cnFillOn = True
res@cnLinesOn = False
res@cnLevelSpacingF = 20.
res@gsnSpreadColors = True
res@lbLabelAutoStride = True
map=gsn_csm_contour_map(wks,datahgt,res)
;>============================================================<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = True ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,map,cnres)
;>============================================================<
draw(map)
frame(wks)
end
|
-
海拔高度图
|