Skip to content

Easy iteration over slices of a DataArray #266

Closed
@andreas-h

Description

@andreas-h

The DataArray object would benefit from functionality similar to iris.cube.Cube.slices. Given an array

 [23]: data.coords 
Out[23]: 
Coordinates:
  * sza      (sza) float64 0.0 36.87 53.13 60.0 72.54 75.52 81.37 87.13 88.28
  * vza      (vza) float64 0.0 72.54
  * raa      (raa) float64 0.0 60.0 90.0 120.0 180.0
  * wl       (wl) float64 360.0 380.0 400.0 420.0 440.0

it would be nice to be able to do

for sl in data.slices(["raa", "wl"]):
    # do magic with a DataArray of coordinates (sza, vza)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions