- 积分
- 15
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-1-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这段代码 是用来画台风路径的。但是倒入之后一直显示
我也不知道为什么
下面是我的代码,有没有哪位好心人帮我看看到底是哪里错了?
;*************************************************
; traj.ncl
;*************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;**************************************************
begin
;*************************************
; read in data
;************************************
; note this trajectory file contains data in the form of
; 4 variables x 577 timesteps
; fiTY = “TF_FCST.TXT”
; ntime = numAsciiRow(fiTY)
ntime = 577
lat=new(ntime,"float")
lon=new(ntime,"float")
alldata=asciiread("TF_FCST.TXT",-1,"string")
lat=stringtofloat(str_get_field(alldata,2," "))
lon=stringtofloat(str_get_field(alldata,3," "))
;********************************************
wks = gsn_open_wks("X11","HaitangTrack") ; open workstation
res = True ; map resources
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
; res@vpWidthF = 0.80 ; make map bigger
; res@vpHeightF = 0.80
res@mpMaxLatF = 30 ; select subregion
res@mpMinLatF = 15
res@mpMinLonF = 115
res@mpMaxLonF = 145
res@mpLandFillColor = "old lace" ;160
res@mpOceanFillColor = "white"
res@mpGridAndLimbOn = "True"
res@mpGridMaskMode = "MaskNotOcean"
res@mpGridLineDashPattern = 15
res@mpGridSpacingF = 5.0
res@mpOutlineOn = True
res@mpOutlineBoundarySets = "National"
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpOutlineSpecifiers = "China:States"
res@tiMainString = "Haitang"
res@tiMainString = "2005HaitangTrack" ; title
res@gsnCenterString = "markers every 4th time step" ; center string
plot = gsn_csm_map_ce(wks,res) ; create map
;*********************************************
; trajectory parameters
;*********************************************
;*********************************************
; some plot parameters
;*********************************************
pres = True ; polyline resources
pres@gsLineThicknessF = 2.0 ; line thickness
colors= (/"red"/) ; line color
mres = True ; marker resources
first = True ; start of traj resources
;********************************
resLine = True
resLine@gsLineThicknessF = 3
resLine@gsLineColor = "magenta"
mres@gsMarkerIndex = 16 ; marker style (circle)
mres@gsMarkerSizeF = 2.0 ; marker size
mres@gsMarkerColor = "red" ; maker color
dumLine=new(ntime,graphic)
dumDot =new(ntime,graphic)
do j=0,ntime-2
xx=(/lon(j),lon(j+1)/)
yy=(/lat(j),lat(j+1)/)
dumLine(j)=gsn_add_polyline(wks,plot,xx,yy,resLine)
dumDot(j)=gsn_add_polymarker(wks,plot,lon(j),lat(j),mres)
end do
dumDot(ntime-1)=gsn_add_polymarker(wks,plot,lon(ntime-1),lat(ntime-1),mres)
draw(plot)
frame(wks)
end
|
|