- 积分
- 9791
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-3-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 lightmoon 于 2021-1-30 17:00 编辑
今天在伽蓝鸟的回复中了解到了basemap这个地形遮盖指令,打开了新世界的大门。结果发现自己GrADS上用不了,报错,但是呢又不敢再去问,怎么办呢,就只能自己打开源码来纠错啦。
输入指令为:basemap L 15 1 L
当时的报错指令为:
sh: bash: command not found
Error reading opoly_lowres.asc
首先,我们了解basemap函数输入的指令为 basemap L(and)/O(cean) <fill_color> <outline_color> <L(owres)/M(res)/H(ires)>
输入参数有 陆地/海洋 填充颜色 边框颜色 地图分辨率 (当然这些除了第一个参数都有默认值)
言归正传,开始查错,打开basemap代码后我发现,sh: bash: command not found的错误是由于下面这块产生的,
wget_it = 'wget ftp://grads.iges.org/grads/scripts/'file' .'
scrp = 'if test -e ' file '; then true; else ' wget_it '; fi'
'! bash -c "'scrp'"'
endif
好家伙,没有这个文件从官网下?我们不用管它,直接给他注释掉,当然这也提示了我们,是否是应为需要读取的海陆文件不存在导致的第二个错误。
于是我找到了关于读取文件的部分,
if (type = 'L' | type = 'l')
* if (lowres); file = 'lpoly_US.asc'; endif
if (lowres); file = 'opoly_lowres.asc'; endif
if (mres) ; file = 'lpoly_mres.asc' ; endif
if (hires) ; file = 'lpoly_hires.asc' ; endif
endif
if (type = 'O' | type = 'o')
if (lowres); file = 'opoly.asc'; endif
if (mres) ; file = 'opoly_mres.asc' ; endif
if (hires) ; file = 'opoly_hires.asc' ; endif
endif
result = read(file)
rc = sublin(result,1)
rc = subwrd(rc,1)if (rc!=0)
say 'Error reading 'file
return
endif
nwcmd = sublin(result,2)
然后我找到了这几个文件。发现位于"C:\opengrads\Contents\Cygwin\Versions\2.1.a2.oga.1\asc\"内,需要在basemap中加入文件全路径,注意某些文件名在函数中和文件夹中可能有细微区别,需要自行更改。结果如图
basemap L 15
最后的最后,再次感谢伽蓝鸟热心回复
PS:刚才搜索basemap的时候发现已经有人发现这个问题了~~,不过这也是我独立解决的hh,就不撤回了。
|
-
评分
-
查看全部评分
|