Grib with 3.12 grid not loading

20 views
Skip to first unread message

Karl De Vine

unread,
Feb 25, 2019, 11:19:21 AM2/25/19
to Iris-dev
Hi,
Am fairly new to iris and have some grib2 files with 3.12 transverse mercator projection which I'm unable to load:

iris.exceptions.TranslationError: Grid definition section 3 contains unsupported source of grid definition [12]

This is with Iris 2.2.0 . Similar error occurs with iris_grib.

Can someone please point me in the right direction with these files. Not keen on building a custom loader.

Thanks
Karl

Klaus Zimmermann

unread,
Feb 26, 2019, 9:59:52 AM2/26/19
to scitools...@googlegroups.com
Hi Karl,

could you share the whole stacktrace with us?

That would really help pin it down.

Cheers
Klaus
> --
> You received this message because you are subscribed to the Google
> Groups "Iris-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scitools-iris-...@googlegroups.com
> <mailto:scitools-iris-...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Karl De Vine

unread,
Feb 26, 2019, 10:03:14 AM2/26/19
to Iris-dev
thanks for looking
 
>>> levels=iris.load("201902251200_u1096_ng_umqv_Wholesale1.grib")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/miniconda3/lib/python2.7/site-packages/iris/__init__.py", line 343, in load
    return _load_collection(uris, constraints, callback).merged().cubes()
  File "/root/miniconda3/lib/python2.7/site-packages/iris/__init__.py", line 313, in _load_collection
    result = iris.cube._CubeFilterCollection.from_cubes(cubes, constraints)
  File "/root/miniconda3/lib/python2.7/site-packages/iris/cube.py", line 145, in from_cubes
    for cube in cubes:
  File "/root/miniconda3/lib/python2.7/site-packages/iris/__init__.py", line 300, in _generate_cubes
    for cube in iris.io.load_files(part_names, callback, constraints):
  File "/root/miniconda3/lib/python2.7/site-packages/iris/io/__init__.py", line 210, in load_files
    for cube in handling_format_spec.handler(fnames, callback):
  File "/root/miniconda3/lib/python2.7/site-packages/iris/fileformats/rules.py", line 429, in load_cubes
    user_callback_wrapper=loadcubes_user_callback_wrapper):
  File "/root/miniconda3/lib/python2.7/site-packages/iris/fileformats/rules.py", line 350, in _load_pairs_from_fields_and_filenames
    cube, factories, references = _make_cube(field, converter)
  File "/root/miniconda3/lib/python2.7/site-packages/iris/fileformats/rules.py", line 293, in _make_cube
    metadata = converter(field)
  File "/root/miniconda3/lib/python2.7/site-packages/iris_grib/_load_convert.py", line 2515, in convert
    grib2_convert(field, metadata)
  File "/root/miniconda3/lib/python2.7/site-packages/iris_grib/_load_convert.py", line 2464, in grib2_convert
    grid_definition_section(field.sections[3], metadata)
  File "/root/miniconda3/lib/python2.7/site-packages/iris_grib/_load_convert.py", line 1247, in grid_definition_section
    raise TranslationError(msg)

Klaus Zimmermann

unread,
Feb 26, 2019, 11:39:31 AM2/26/19
to scitools...@googlegroups.com
Hi Karl,

thanks, that helps to locate the problem.

In general, iris always reads grib data via iris_grib, the two are not
separate projects.

Unfortunately, I think what you are looking for actually is a missing
feature of iris_grib.

I saw that you opened the new issue #140 and I think that is exactly the
right thing to do. Let's hope somebody can find the time to implement it.

One tip for the issue: if you surround the header with a leading blank
line and a triple backtick(`) ala

```
Grib header is:
#============== MESSAGE 1 ( length=434207 ) ==============
GRIB {
# Meteorological products (grib2/tables/4/0.0.table)

discipline = 0;
editionNumber = 2;
# U.K. Met Office - Exeter (common/c-11.table)
...
```

the formatting is much clearer.

Let's continue the discussion in the ticket.

Cheers
Klaus
Reply all
Reply to author
Forward
0 new messages