C2SM / icon-vis

Collection of Python scripts and notebooks to demonstrate plotting on the ICON grid.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plot read-only grib files

DanielLeuenberger opened this issue · comments

When plotting a grib file, an index file is generated in the same folder than the original grib file. When the directory is not writable, this is not possible. Is there a way to circumvent this?

Hi Daniel, The index file is created by cfgrib, and can be turned off as per their instructions here:
https://github.com/ecmwf/cfgrib#grib-index-file

GRIB index file
By default cfgrib saves the index of the GRIB file to disk appending .idx to the GRIB file name. Index files are an experimental and completely optional feature, feel free to remove them and try again in case of problems. Index files saving can be disable passing adding indexpath='' to the backend_kwargs keyword argument.

eg as below.

psy.open_dataset(
                file,
                engine="cfgrib",
                backend_kwargs={"indexpath": "", "errors": "ignore"},
            )

Let me know if this is still not solving the issue.

Thanks for this info. Together with the documentation, I managed to plot also read-only grid files.