Open pgierz opened 4 years ago
Is there a way to tell pynio to use a specific file?
If so, something like xr.open_dataset("/path/to/file.grb", engine="pynio", backend_kwargs=dict(code_table="/path/to/codetab"))
should work
Apparently this is possible by setting an environmental variable: http://www.pyngl.ucar.edu/NioFormats.shtml#GRIB1-user-defined-parameter-tables
So, if I have my codetable at /path/to/codetab
; I can set NIO_GRIB_PTABLE_PATH=/path/to/codetab
. I'm honestly not too happy with this solution. Would it be possible to add something like backend_env
to open_dataset
; where I can specify environmental variables that are active during opening, and then restore the environment afterwards?
I would love that feature. Also found that pyngl docu but didn’t get it working...
I can have a look at implementing this. Might be a nice opportunity to actually contribute to some of the packages I use every day ;-)
I would use it with the echam6 and jsbach ‘.codes’ files in MPIESM.
Me too! Then we have a good test case :-)
This was my workaround. https://github.com/aaronspring/pymistral/issues/19
It is possible to set ECCODES_DEFINITION_PATH
in eccodes
, see http://download.ecmwf.int/test-data/eccodes/html/namespaces.html. But the codetab
you want to use here from MPIESM grb
output is a CDO parameter table, see https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#section.1.8, so in my understanding something CDO internal and likely not usable with eccodes
/cfgrib
.
Hello,
I'd like to open some old-school Grib files from one of our climate models. I'm using the
PyNIO
backend for this; which works pretty well so far -- at least the data opens! However, I am getting errors:So, would it somehow be possible to provide a code table to be used when opening grb files? I have files next to my output where the codes are stored. An example is below.
I can imagine something like:
Would this be difficult to implement? Cheers, Paul