iris.iterate

Cube functions for iteration in step.

In this module:

iris.iterate.izip(*cubes, **kwargs)[source]

Return an iterator for iterating over a collection of cubes in step.

If the input cubes have dimensions for which there are no common coordinates, those dimensions will be treated as orthogonal. The resulting iterator will step through combinations of the associated coordinates.

Args:

  • cubes (iris.cube.Cube):

    One or more iris.cube.Cube instances over which to iterate in step. Each cube should be provided as a separate argument e.g. iris.iterate.izip(cube_a, cube_b, cube_c, ...).

Kwargs:

  • coords (string, coord or a list of strings/coords):

    Coordinate names/coordinates of the desired subcubes (i.e. those that are not iterated over). They must all be orthogonal (i.e. point to different dimensions).

  • ordered (Boolean):

    If True (default), the order of the coordinates in the resulting subcubes will match the order of the coordinates in the coords keyword argument. If False, the order of the coordinates will be preserved and will match that of the input cubes.

Returns

An iterator over a collection of tuples that contain the resulting subcubes.

For example:
>>> e_content, e_density = iris.load_cubes(
...     iris.sample_data_path('space_weather.nc'),
...     ['total electron content', 'electron density'])
>>> for tslice, hslice in iris.iterate.izip(e_content, e_density,
...                                         coords=['grid_latitude',
...                                                 'grid_longitude']):
...    pass