I'm trying to get the uvIndex
of all the lat,lng present in a grib2 file.
This is the link from where I'm getting the file. The problem is I'm not able to understand the structure of the file so that I can get the data. I'm using pygrib
to read the file.
Here's the code I've tried:
grbs = pygrib.open('uv.t12z.grbf01.grib2')
grb = grbs.select(name='UV index')[0]
print grb.data(23.5,55.5)
What I'm trying to achieve is either iterate over all the lat longs and print the corresponding uvIndex value or enter a lat long and get the corresponding value. Read the docs of pygrib
but couldn't find any suitable command that will serve my purpose. Please help.