NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Greetings! The short answer here is that the problem is due to there being no CF projection ("grid mapping") metadata for MetPy to parse, so it cannot generate the CRS object. There are indeed lat/lon coordinates that can be used for some basic plotting--but these are 2-dimensional and thus cannot be treated as primary coordinates. The native projection for the HRRR grid is Lambert Conformal. There's an open issue on MetPy to add some support for the cfgrib metadata: https://github.com/Unidata/MetPy/issues/2473 but no movement thus far and not likely to be a priority for us any time soon. There are also open issues on cfgrib related to this: https://github.com/ecmwf/cfgrib/issues/251 https://github.com/ecmwf/cfgrib/issues/77 To work-around this, you can create the appropriate CRS manually or inject the appropriate CF metadata manually. Cheers, Ryan On Tue, Aug 30, 2022 at 1:07 AM Ken Harris <kjh@xxxxxxxxxxx> wrote: > People : > > I'm trying to plot HRRR data from a nomads grib2 file, but > metpy.parse_cf doesn't set metpy_crs . There seems to be enough > attributes (eg : GRIB_gridType, etc). Attached is some python code > that fetches a grib2 file from nomads (and writes it into the local > directory) , then reads (w/ xarray w/ cfgrib) then metpy.parse_cf, > then prints metpy_crs. It's works OK w/ GFS ( Projection: > latitude_longitude ), but the HRRR files gives an error : KeyError: > 'metpy_crs' > > Do I have to call assign_crs / assign_latitude_longitude or should > parse_cf do this ? > > Thanks, > Ken > _______________________________________________ > NOTE: All exchanges posted to Unidata maintained email lists are > recorded in the Unidata inquiry tracking system and made publicly > available through the web. Users who post to any of the lists we > maintain are reminded to remove any personal information that they > do not want to be made public. > > > python-users mailing list > python-users@xxxxxxxxxxxxxxxx > For list information, to unsubscribe, or change your membership options, > visit: https://www.unidata.ucar.edu/mailing_lists/ > -- Ryan May Unidata Deputy Director UCAR Boulder, CO
python-users
archives: