Skip to content

Add step argument to Cube.rolling_window #7217

Description

@mo-AndrewCreswick

✨ Feature Request

Add a step argument to iris.cube.Cube.rolling_window to match the behaviour of iris.util.rolling_window.

Currently Cube.rolling_window only supports overlapping windows and uses iris.util.rolling_window applied to the cube data, coordinate points and coordinate bounds.
iris.util.rolling_window also has support for strided windows using the step argument, however this is not available at the cube level.

A backwards compatible default of step=1 would give identical results to the current implementation of Cube.rolling_window.

Motivation

This would extend the flexibility of Cube.rolling_window and would enable easier calculation of some common meteorological diagnostics. For example, the calculation of minimum temperature in non-overlapping time periods such as T+1 to T+3, T+4 to T+6 etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions