[python #KDL-157609]: Intern for Nick Lilja
- Subject: [python #KDL-157609]: Intern for Nick Lilja
- Date: Fri, 26 Jun 2020 15:44:57 -0600
Hello! Thanks for reaching out.
Apologies for the delay in responding. I've put together for you a short
Jupyter notebook demonstration available on GitHub
to highlight what interacting with GRIB files with pygrib can look like. Pygrib
will return your output from `gribmessage.values` as a NumPy array or
maskedarray. The corresponding latitudes and longitudes that come out of
`gribmessage.latlons()` should mirror the shape of your data values and allow
you to dig into plotting. Our python-training website
https://unidata.github.io/python-training/) has various examples for using
cartopy for map-style plots and displays!
I hope this helps. If I didn't quite help with where you're at, don't hesitate
to follow up and let me know and I should be able to respond to you much
quicker this time! I may also take some time to update that notebook with a
plotting example if it would help. Thanks again for reaching out.
All the best,
> To whom this concerns,
> I have a few questions about using Python and the 'pygrib' library for
> interacting with '.grib2' files.
> I'm trying to grab the hour, temperature, lat, lon, and precipitation values
> from a .grib2 dataset.
> When printing a line in the dataset, output looks like this:
> 38:Temperature:K (instant):lambert:isobaricInhPa:level 100000 Pa:fcst time 1
> hrs:from 20131206050
> According to
> I can use '.select()' to grab keys then use '.values' to extract the values
> from the respective keys.
> The problem is, I'm having trouble correctly hitting the right keys, and
> pulling the correct values. For example, after selecting the 'Temperature'
> key and printing out the values, the output is lists of lists of
> temperatures. The output doesn't makes sense to me to graph it.
> How do I grab the right keys, and get the right values?
Ticket ID: KDL-157609
Department: Support Python
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.