1

I'm using Iris module to convert from netcdf to grib2:

import iris

cubes = iris.load('SST.nc')       # each variable in the netcdf file is a cube
data=cubes[0]

data.coord('lat').coord_system=iris.coord_systems.GeogCS(4326)
data.coord('lon').coord_system=iris.coord_systems.GeogCS(4326)
print (data)
iris.save(data, 'SST_test.grib2')  # save a specific variable to grib

But I can't save in grib2! I saw other users can do it with the same iris module, but I don't know where is the problem. I got the following error: "Unable to save GRIB file - "iris_grib" package is not installed."

I've just installed iris 2.2.0 in Python 3.7. The iris_grib module is not available to Python 3.7.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • I would recommend using [miniconda](https://docs.conda.io/en/latest/miniconda.html) to take care of the different dependencies. Create a new conda environment containing all the Python modules that you need. – Basileios Aug 13 '19 at 19:01
  • I used Iris module with miniconda, but it didn't work. – Gaston Lopez Aug 14 '19 at 00:41
  • You also need to include iris-grib as the error message clearly states. So the actual problem is not in your code but rather in installation of the right packages. – Basileios Aug 14 '19 at 04:46
  • I tried to install iris-grib module, but it didn't in Python 3.7. However, in the following example didn't use iris-grib module: https://github.com/rsignell-usgs/ipython-notebooks/blob/master/files/Iris_CFSR_wave_wind.ipynb – Gaston Lopez Aug 14 '19 at 14:05

0 Answers0