- 积分
- 6749
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-3-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 zzw9701 于 2020-1-2 19:56 编辑
对Python不怎么了解,只是用来下载ERA的数据,脚本之前都可以下载,现在不知道为什么下不了了,出现以下错误,有知道是什么问题的大佬嘛/mars - ERROR - 20191223.152152 - file (standard input) line 1 : syntax error
mars - ERROR - 20191223.152152 - file (standard input) line 1 : unexpected character in input '/'
mars - FATAL - 20191223.152152 - No request
Traceback (most recent call last):
File "D:\ERA_Interim\F\MODEL\ERA-Interim_sfc.py", line 21, in <module>
"target": "D:/ERA_Interim/F/MODEL/ECMWF_surface"+data[idata]+".grib",#这里是下载路径和文件名,netcdf文件自然后缀名是nc
File "D:\Python\lib\site-packages\ecmwfapi\api.py", line 520, in retrieve
c.execute(req, target)
File "D:\Python\lib\site-packages\ecmwfapi\api.py", line 463, in execute
self.connection.wait()
File "D:\Python\lib\site-packages\ecmwfapi\api.py", line 360, in wait
self.call(self.location, None, "GET")
File "D:\Python\lib\site-packages\ecmwfapi\api.py", line 140, in wrapped
return func(self, *args, **kwargs)
File "D:\Python\lib\site-packages\ecmwfapi\api.py", line 340, in call
raise APIException("ecmwf.API error 1: %s" % (self.last["error"],))
ecmwfapi.api.APIException: 'ecmwf.API error 1: Bad request'
以下是我的脚本:
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
data=["2010"]#,"2010","2011","2012","2013","2014","2015","2009","2010"
for idata in range(len(data)):#这里写了一个循环,根据data里面的年份循环
server.retrieve({
"class": "ei",
"dataset": "interim",
'date' : data[idata]+"0301"+"/to/"+data[idata]+"0331",
"expver": "1",
"grid": "0.25/0.25",
"levtype": "sfc",
"param": "34.128/31.128/134.128/151.128/235.128/167.128/165.128/166.128/168.128//141.128/139.128/170.128/183.128/236.128/39.128/40.128/41.128/42.128/33.128",#
"step": "0",
"stream": "oper",
"time": "00/06/12/18",
"type": "an",
'area' : "60/80/0/180",#这里是下载区域范围,按照 90N -180W -90S 180E的范围填写
'format' :'grib',#这里是下载格式,不写的话是下载grib文件的
"target": "D:/ERA_Interim/F/MODEL/ECMWF_surface"+data[idata]+".grib",#这里是下载路径和文件名,netcdf文件自然后缀名是nc
})
找到错误的原因了:“param”里面多了一个“/”号。
|
|