SciTools / iris-grib

GRIB interface for Iris.
https://iris-grib.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
23 stars 43 forks source link

Loading grib 1 doesn't create realization dimension #336

Open nhsavage opened 1 year ago

nhsavage commented 1 year ago

when loading grib 1 data from an ensemble the loader does not add a realization dimension based on the perturbationNumber

This is done for Grib 2 data. Unfortunately, at least ECMWF and possibly other centres are still using GRib 1 for new data on single levels (but not on model levels)

This should be simple to add in _grib1_load_rules.py

    if grib.perturbationNumber != -1.0:
        dim_coords_and_dims.append(
            (
                DimCoord(
                    points=grib.perturbationNumber,
                    standard_name='realization',
                    units='no_unit',
                ),
                0
            )
        )
        )

I am currently handling easily with a callback so this is more of a nice to have

s-boardman commented 1 year ago

We do the same thing in the StaGE library code. Having it automated would be neat.

trexfeathers commented 1 year ago

Can we be sure that this won't also affect situations where there genuinely shouldn't be a realization dimension?

(I'm not arguing, we just rely on the wisdom of our users!)

s-boardman commented 1 year ago

Can we be sure that this won't also affect situations where there genuinely shouldn't be a realization dimension?

(I'm not arguing, we just rely on the wisdom of our users!)

As in loading deterministic data? I've not used any in grib format so couldn't comment unfortunately.