Skip to content

[PI] Cube operations support for Ancillary Variables #3483

@pp-mo

Description

@pp-mo

Content update 2019-12-09
The notes below identify various problem areas, which leads to the following division of sub-tickets
(Todo list) :


Original summary

Followon from #3422

A bunch of cube operations are not respecting Ancillary Variables.
We are deferring these issues from #3422.
See this comment to #3422.

In principle, for most of these things the handling should be the same as for AuxCoords and (probably) CellMeasures. Unfortunately, it seems that there are some nasty outstanding bugs relating to CellMeasures anyway -- e.g. they don't survive cube.copy() !.

At least these operations need fixing :

  • cube indexing (__getitem__) is discarding AVs, even when they don't map to the indexed dimension
  • cube.copy() is discarding AVs
    • and it is also discarding CellMethods !
  • cube equality (__eq__) is ignoring AVs
    • but not AuxCoords.
    • CellMethods I'm not sure ?
  • updated 2019-11-22 above core cube ops are now fixed
  • cube arithmetic is discarding AVs
    • but not AuxCoords.
    • CellMethods I'm not sure ?
    • ( note : probably fixed by fixing 'copy' ? )
  • cube.collapsed() is discarding AVs
    • even when they don't map to collapsed dimensions
    • for AuxCoords it applies the same aggregator as the main data
    • for CellMethods I'm not sure
  • cube.xml ignores AVs
    • also CellMethods ?
    • but not AuxCoords.

There is also a longer list of 'similar' cube operations which should be checked, some of which may be fixed "automatically" by addressing the above ones, and others possibly not :

  • stats : aggregated_by; rolling_window
  • regrid-like : regrid, interpolate,
  • index-like : extract, subset, intersection,

Notes:

  1. In all the cases where the result dimensions are different from the input, we need to check for correct handling both when Ancillary Variables are mapped over the modified/lost dimensions, and when they are not.
  2. in some cases, the appropriate solution may not be the same for all of AuxCoords, CellMeasures and Ancillary Variables.
    • for example, AuxCoords are regridded with the main data : Probably is also appropriate for Ancillary Variables (the nature and meaning of which is not known), but arguably not to Cell Measures (where it is).

NOTE:
It may well prove appropriate to fix these issues by grouping together AuxCoords, CellMeasures and AncillaryVariables, and handling them all similarly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions