Skip to content

PP round trip loses realization coordinate #4747

@rcomer

Description

@rcomer

🐛 Bug Report

When saving and reloading a cube to/from pp, its realization coordinate is lost.

How To Reproduce

Steps to reproduce the behaviour:

import iris
print(f"{iris.__version__=}")

fname = iris.sample_data_path("GloSea4", "ensemble_004.pp")

cube1 = iris.load_cube(fname)
print(cube1)

iris.save(cube1, "test.pp")

cube2 = iris.load_cube("test.pp")
print(cube2)

Gives:

iris.__version__='3.2.1'
surface_temperature / (K)           (time: 6; latitude: 145; longitude: 192)
    Dimension coordinates:
        time                             x            -               -
        latitude                         -            x               -
        longitude                        -            -               x
    Auxiliary coordinates:
        forecast_period                  x            -               -
    Scalar coordinates:
        forecast_reference_time     2011-07-20 00:00:00
        realization                 4
    Cell methods:
        mean                        time (1 hour)
    Attributes:
        STASH                       m01s00i024
        source                      'Data from Met Office Unified Model'
        um_version                  '7.6'
surface_temperature / (K)           (time: 6; latitude: 145; longitude: 192)
    Dimension coordinates:
        time                             x            -               -
        latitude                         -            x               -
        longitude                        -            -               x
    Auxiliary coordinates:
        forecast_period                  x            -               -
    Scalar coordinates:
        forecast_reference_time     2011-07-20 00:00:00
    Cell methods:
        mean                        time (1 hour)
    Attributes:
        STASH                       m01s00i024
        source                      'Data from Met Office Unified Model'
        um_version                  '7.6'

cube1 has realization 4, cube2 has no realization coordinate.

Expected behaviour

cube1 and cube2 should be the same.

Environment

  • OS & Version: RHEL7
  • Iris Version: 3.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions