爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 13197|回复: 10

[脚本编辑] grads提示Data Request Error: Invalid grid coordinates

[复制链接]

新浪微博达人勋

发表于 2017-9-30 18:31:13 | 显示全部楼层 |阅读模式

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

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

x
请教一下会grads的小伙伴,用grads画图出现了一个错误:
系统提示如下:
Data Request Error: Invalid grid coordinates
  World coordinates convert to non-integer  grid coordinates
    Variable = uwndclim  Dimension = 3
  Error ocurred at column 6

原gs文件:(另附件可直接下载)
'reinit''open D:\grads2\ex4.ctl''open D:\grads2\clim_ex4.ctl''set lon  90 270''set lat -30  60''set lev 850''run define_colors.gs'len=0.25scale=5'set dfile 2''set t 1 12''define uwndclim=uwnd''define vwndclim=vwnd''define slpclim =slp''modify uwndclim seasonal''modify vwndclim seasonal''modify slpclim  seasonal''set dfile 1''set t 1 24''define uwndanom=uwnd-uwndclim''define vwndanom=vwnd-vwndclim''define slpanom = slp/100.-slpclim't=11while(t<=16)    monstr=getmonstr(t)    if (t>12)        mon=t-12        timestr=15%monstr%1998    else        mon=t        timestr=15%monstr%1997    endif    'set time ' timestr     x0=math_int((t-11)/3)    y0=math_mod((t-11),3)    xl=0    xr=0    cb=0.8    wd=(11-xl*2-xr*2-cb)/2    xmin=xl+(wd+xl+xr)*x0     xmax=xmin+wd             yt=0.1    yb=0.2    ht=(8.5-yt*3-yb*3)/3    ymax=8.5-yt-(ht+yt+yb)*y0    ymin=ymax-ht    'set parea 'xmin' 'xmax' 'ymin' 'ymax    'set gxout shaded'    'set grads off'    'set grid off'    'set clevs -10 -7 -5 -3 -2 -1 1 2 3 5 7 10'    'set ccols 99  97  95   94   93    92   0   82  83     84   85    87   89'    'd slpanom'    'set arrscl 'len' 'scale    'set arrowhead -0.4'    'set arrlab off'    'set ccolor 1'    'd skip(uwndanom,3);skip(vwndanom,3)'    if (mon=3)        'cbarn 1 1'    endif    'q w2xy 90 55'    xl=subwrd(result,3)    yl=subwrd(result,6)    'q w2xy 108 65'    xo=subwrd(result,3)    yo=subwrd(result,6)     'set line 1'    'draw rec  'xl' 'yl' 'xo' 'yo    'set line 0'    'draw recf 'xl' 'yl' 'xo' 'yo    'set string 1 c'    'draw string 'xo/2+xl/2' 'yo/2+yl/2' 'monstr   t=t+1endwhile rc = arrow(10.3,0.8,len,scale)'gxprint D:\grads2\4-2.png white'function arrow(x,y,len,scale)'set line 1 1 4''draw line 'x-len/2.' 'y' 'x+len/2.' 'y'draw line 'x+len/2.-0.05' 'y+0.04' 'x+len/2.' 'y'draw line 'x+len/2.-0.05' 'y-0.04' 'x+len/2.' 'y'set string 1 c''set strsiz 0.12''draw string 'x' 'y-0.13' 'scalereturnfunction getmonstr(mon)mon=math_mod(mon,12)if(mon=1)    monstr='JAN'endifif(mon=2)    monstr='FEB'endifif(mon=3)    monstr='MAR'endifif(mon=4)    monstr='APR'endifif(mon=5)    monstr='MAY'endifif(mon=6)    monstr='JUN'endifif(mon=7)    monstr='JUL'endifif(mon=8)    monstr='AUG'endifif(mon=9)    monstr='SEP'endifif(mon=10)    monstr='OCT'endifif(mon=11)    monstr='NOV'endifif(mon=12|mon=0)    monstr='DEC'endifreturn monstr;这是我的上机作业,上传的gs文件是老师供我们参考的,若有侵犯版权问题,我会及时删帖的。最后,祝各位小伙伴们国庆节快乐!

temp.gs

3.24 KB, 下载次数: 2, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-9-30 18:31:57 | 显示全部楼层
为啥乱码了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-9-30 18:41:27 | 显示全部楼层
咋把这个帖删掉呀
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-4-4 15:16:02 | 显示全部楼层
CheneyJOJO 发表于 2017-9-30 18:41
咋把这个帖删掉呀

楼主知道错误原因了吗?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-4-9 20:55:14 | 显示全部楼层
irides 发表于 2018-4-4 15:16
楼主知道错误原因了吗?

那个问题已解决啦,好像是grads打开方式出现了问题。
因为后面gis脚本也没有改,重启电脑之后运行又成功了。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-4-10 08:13:58 | 显示全部楼层
CheneyJOJO 发表于 2018-4-9 20:55
那个问题已解决啦,好像是grads打开方式出现了问题。
因为后面gis脚本也没有改,重启电脑之后运行又成功 ...

好的吧,谢谢楼主
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-5-3 15:31:07 | 显示全部楼层
好吧,解决的方式好奇怪
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-7-23 17:43:32 | 显示全部楼层
我也是遇到这个问题,请问解决了吗
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-7-23 17:44:22 | 显示全部楼层
我的精度转化是0.09转到0.125,用的grads里面的re()函数
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-4-18 19:52:33 | 显示全部楼层
我也遇到这个问题。不知道该怎么办了。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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