[Tutor] grb.select for multiple times

Alan Gauld alan.gauld at yahoo.co.uk
Wed Mar 1 20:39:12 EST 2017

On 01/03/17 18:23, Jason Snyder wrote:
> I have a grib2 file with wind data at multiple taus as shown below:

This list is for the core Python language and standard library.
For anything outside that you are more likely to get answers
on the specific library support forum or community.

If that fails you need to give us a lot of context. Don;t asume we know
anything about your area of speciality, certainly few of us work with
wind data, and have no idea what taus are. We are certainly not
generally familiar with grib2.

> 3:485167:d=2017030112:UGRD:10 m above ground:3 hour fcst:
> 8:1652471:d=2017030112:UGRD:10 m above ground:6 hour fcst:
> 13:2704909:d=2017030112:UGRD:10 m above ground:9 hour fcst:
> Now what I would like to do is plot these wind values at the different taus
> in a time series.  I have tried to work with the following code:
> grbs=pygrib.open(grib)
> uwind = grbs.select(name='10 metre U wind component')
> uwnddata=uwind.values

None of that makes any sense to us(*) because it's all in the module.
You need to explain what each line is doing, what kind of
object you expect back, what the various parameters represent, etc.
(In so doing you will often solve your own problem!)

(*)Most of us at leadt. You may luck out and find somebody else who
uses your module and can help. But it will be a stroke of
luck if you do.

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list