Open logi opened 4 years ago
those template files are part of the eccodes library - they exist in /usr/local/share/eccodes/definitions/grib2 (if eccodes is installed in /usr/local). If you can create the correct template file (based on info here https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-32769.shtml) and drop it in there, it might work
I added a template.3.32769.def
file containing this
# (C) Copyright 2005- ECMWF.
# TEMPLATE 3.32769, Rotated Latitude/longitude (Arakawa Non-E Staggered)
include "grib2/template.3.shape_of_the_earth.def";
include "grib2/template.3.latlon.def";
and added this line to section.3.def
"rotated_arakawa_none" = { gridDefinitionTemplateNumber=32679; PLPresent=0; }
in the concept gridType
structure, and now it reads the files. I doubt the latlons
method will work correctly with more work though.
If you don't have permission to add those files, you can copy the directory somewhere can write to, add the files there and then use ECCODES_DEFINITION_PATH
to tell eccodes where they are.
Sent an email to Software.Support@ecmwf.int about adding support for this grid in eccodes. Will post here if I receive a reply.
Note that pull request #35 is no longer helpful in this case since pygrib isn't using the NCEP g2clib any longer.
version 2.1.2 (PR #169) will have this workaround included (if you install a binary wheel with pip)
@logi would you mind installing a binary wheel for 2.1.2 using pip install and see if you then can read a RAP grib file?
I ended up using a lower-level library and constructing the projection and the lat/lon values by hand and don't want to ever touch that code again... However, I'll give this change a spin for the benefit of mankind ;-)
I am doing exactly as described in the merged pull request https://github.com/jswhit/pygrib/pull/35 by @bschwedler nearly 4 years ago, reading Rapid Refresh output files, but opening the files is failing with this error repeated about 3300 times:
Should pygrib not come with these template files? If not, do they exist anywhere and might it be worth documenting where and how to get them? Or at least to tell me :-)