Reading in reduced Gaussian gridded data (e.g., ERA-Interim)

553 views
Skip to first unread message

ScottHosking

unread,
Oct 3, 2013, 12:19:27 PM10/3/13
to scitoo...@googlegroups.com
Will there be support for reading in ERA-Interim reduced Gaussian grids in Iris v1.6 ?

We have a new PhD student starting next week and I'd like to suggest they start using Python/Iris rather than IDL.


Andrew Dawson

unread,
Oct 6, 2013, 5:42:41 AM10/6/13
to scitoo...@googlegroups.com
Your question is well timed Scott, and it would be great to get some feedback from you on this. A proposal for supporting loading reduced gaussian grids from GRIB is under consideration and would easily make it into v1.6 if accepted. The proposed method is to do an on-the-fly interpolation when reading reduced gaussian grids, so that they will be loaded into a cube on a regular gaussian grid. The question is, how would you like/expect the data to loaded and represented? The options are:

1. To read the data as is resulting in a 1D cube with 2 lat/lon auxiliary coordinates that describe the location of each 1D data point.
2. To interpolate the data to a regular grid at load time so that the result is a structured cube with lat/lon dimension coordinates.

Byron and I felt that option 2 would be most useful as it would allow users to do more useful things with their data more quickly. However, we are happy to have our minds changed on this. Your feedback is important to us on this.

Andrew

ScottHosking

unread,
Oct 8, 2013, 8:24:30 AM10/8/13
to scitoo...@googlegroups.com
Hi Andrew, thanks for the reply.  I've just been discussing this with some colleagues and we agree that #2 would be the most useful default option.  However, it would be handy to have the option of #1 in the future for those very rare occasions when we require the original grid.

It would be great to get this included in v1.6 as it is the major thing holding us back from switching from IDL.

Best,
    Scott


bblay

unread,
Oct 14, 2013, 8:57:21 AM10/14/13
to scitoo...@googlegroups.com
Hi Scott,

It should be in Iris long before 1.6 is released,
it's on the brink of being merged right now.

Regarding the original grid, perhaps using the grib api directly might be a good, quick solution?

import cartopy.crs as ccrs
import gribapi
import iris
import matplotlib.pyplot as plt

with open(filename, "rb") as infile:
  g
= gribapi.grib_new_from_file(infile)
lats
= gribapi.grib_get_double_array(g, "latitudes")
lons
= gribapi.grib_get_double_array(g, "longitudes")
vals
= gribapi.grib_get_double_array(g, "values")
plt
.axes(projection=ccrs.PlateCarree())
plt
.scatter(lons, lats, c=vals)
plt
.gca().coastlines()
plt
.show()

Kind regards,
Byron

Andrew Dawson

unread,
Oct 22, 2013, 4:13:49 AM10/22/13
to scitoo...@googlegroups.com
Hi Scott

Support for loading reduced Gaussian grids from GRIB has now been merged into the main iris code, so it will definitely be in 1.6. You can use it now by installing from the master branch if you don't want to wait for the 1.6 release.

The implementation does on-the-fly interpolation of the reduced data to load it into a cube on a regular grid.

Andrew

ScottHosking

unread,
Oct 22, 2013, 4:55:58 AM10/22/13
to scitoo...@googlegroups.com
Thanks Andrew,

Do you know if v1.6 is still being planned to be released in early November as suggested in the iris-dev google group by Phil Elson ?

see https://groups.google.com/forum/#!topic/scitools-iris-dev/69oYkaHDkj4

Cheers,
    Scott

Andrew Dawson

unread,
Oct 22, 2013, 5:01:43 AM10/22/13
to scitoo...@googlegroups.com
I'm honestly not sure. The last release was delayed by a couple of weeks so I don't know if this will have a knock on effect. I think someone from the Met Office will have to answer this for you.

Reinhard Schiemann

unread,
Sep 28, 2017, 8:30:16 AM9/28/17
to Iris
Hi Andrew/all,

I am trying to use Iris to work with data on a reduced Gaussian grid (from the CNRM model). Iris will read in a 1D cube like this:

>>> print cube
geopotential_height
/ (m)           (-- : 181724)
     
Auxiliary coordinates:
          latitude                      x
          longitude                     x
     
Scalar coordinates:
          air_pressure
: 50000.0 Pa
          time
: 1979-11-01 06:00:00, bound=(1979-11-01 06:00:00, 1979-11-01 06:00:00)
     
Attributes:
         
Conventions: CF-1.7 CMIP-6.0
         
...
          grid
: native atmosphere T359l reduced gaussian grid
          grid_label
: gn


So for each grid box, the latitude and longitude auxiliary coordinates tell me the coordinates of the grid box.

How can I regrid this into a 2D cube with regular latitude/longitude coordinates? 
From what was posted here a few years back (your point 2.), Iris should do that on-the-fly upon loading, but it is not happening in this case ...

Any help would be much appreciated, thanks,

Reinhard
Reply all
Reply to author
Forward
0 new messages