我正在尝试使用来自这里的pygrib读取这里文件。但是读取整个120个文件需要超过4到5个小时。所以我试着做索引来更快地读取文件。每当我试图对值键建立索引时,就会得到以下错误:
msgs = grbindx.select(level = 0, typeOfLevel = "surface",parameterName = "values")
File "pygrib.pyx", line 2003, in pygrib.index.select (pygrib.c:30731)
ValueError: no matches found这是我的密码:
#grb = grbs.select(name='UV index')[0]
#uvi surface 0
grbindx = pygrib.index('uv.t12z.grbf64.grib2','typeOfLevel','level','parameterName')
msgs = grbindx.select(level = 0, typeOfLevel = "surface",parameterName = "values")
print msgs.keys有人能解释我做错了什么吗?
发布于 2016-06-13 06:58:40
grib_ls在这种类型的文件上显示:
edition centre date dataType gridType stepRange typeOfLevel level shortName packingType
2 kwbc 20160612 fc regular_ll 12 surface 0 uvi grid_jpeg
1 of 1 grib messages in uv.t12z.grbf12.grib2因此,试着阅读如下:
grbindx = pygrib.index('uv.t12z.grbf64.grib2','typeOfLevel','level','shortName')
msgs = grbindx.select(level = 0, typeOfLevel = "surface",shortName = "uvi")
print msgs但是,我想,你不会加快速度,因为这个文件只有一个记录.
https://stackoverflow.com/questions/37650178
复制相似问题