Skip to content

Why iris.cube.Cube.collapsed requires weights with full shape? #3707

@TomekTrzeciak

Description

@TomekTrzeciak

We are looking at ways to reduce memory footprint of our iris code in https://github.com/metoppv/improver and are somewhat stuck on calculating weighted averages with iris.cube.Cube.collapsed. It looks like Iris insists on weights having the same shape as the collapsed cube even though the underlying numpy.ma.average in iris.analysis.MEAN can happily work with 1D array of weights. Why this restriction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions