爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 9408|回复: 0

[作图] 画轨迹报错!

[复制链接]

新浪微博达人勋

发表于 2020-11-6 14:40:36 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x

  1. begin

  2.    diri="/media/wjj/data/FLEXPART/"
  3.    files = systemfunc ("ls " + diri + "*.txt")
  4.    ntime=dimsizes(files)
  5.    loctn=new((/ntime,39,2/),float,-999)
  6.    do i=0, ntime-1
  7.       print(" "+files(i))
  8.       ;data= asciiread(files(i),(/39,13/),"float")
  9.       nrow=numAsciiRow(files(i));读取行
  10.       ncol=numAsciiRow(files(i))
  11.       lines=asciiread(files(i),(/nrow,ncol/),"float")
  12.       loctn(i,0:nrow-1,0)=lines(0:nrow-1,2);经度
  13.       loctn(i,0:nrow-1,1)=lines(0:nrow-1,3);纬度
  14.       delete(lines)
  15.    end do
  16.    do i=0, ntime-1
  17.    wks = gsn_open_wks("png","traj")               ; send graphics to PNG file
  18.   

  19.    
  20.    res             = True                              ; plot mods desired
  21.    res@gsnFrame    = False                             ; don't advance yet
  22.    res@gsnMaximize = True
  23.    res@gsnDraw          = False   ; so we can add poly stuff
  24.    res@mpDataBaseVersion     =  "MediumRes" ;
  25.    res@mpPerimOn             = False          ;-- don't draw the box around the plot
  26.    res@gsnPolar="SH"
  27.    res@mpCenterLonF          = 0              ;-- center at lon=10
  28.    res@mpMaxLatF          = -30   
  29.    res@mpGridLineColor       = "grey30"         ;-- set grid line color
  30.    res@tiMainString    = ""  ;
  31.    res@gsnCenterString = ""   ; center string
  32.    res@mpFillOn               = False    ;
  33.    res@mpOutlineOn            = True    ; turn on continental outline


  34.    map = gsn_csm_map(wks,res)                        ; gsn_csm_map_ce
  35.    pres                  = True               ; polyline resources
  36.    pres@gsLineThicknessF = 2.0                ; line thickness
  37.   
  38.    pres@gsLineColor = "red"                        
  39.    gsn_polyline(wks,map,loctn(i,:,0),loctn(i,:,1),pres)      ; draw the traj
  40.    draw(map)                                          
  41.    frame(wks)
  42.    end do                                       
  43.   
  44. end
复制代码

代码写成这样,还是报错,求指教!
warning:asciiread: End of file reached and only (507) elements were read from the file, filling remaining elements with the default missing value for the requested type


密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表