Skip to content

Add 'construct' method to Coarsen objects #5625

Closed
@ACHMartin

Description

@ACHMartin

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Similarly to the 'construct' method for Rolling objects, I think it will make sense to have the same for Coarsen objects.

My use will be for my da:
da(lon, lat, time) of dimension (2000, 1600, 240)
I wish to coarsen the data by a factor 4 in lon and lat (Lon and Lat), but wish to keep the data in a new dimension, it would be:
da(Lon, Lat, time, samples) of dim (500, 400, 240, 16)

my aim is to do da.median(dim=['time','samples'])

Describe the solution you'd like
A clear and concise description of what you want to happen.

da.coarsen(lon=4, lat=4, , boundary="trim").construct('samples')

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

I am using Rolling objects, but it increases the size of the matrix.

Many thanks for your work

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