cf.Coordinate.subspace

Coordinate.subspace

Return a new bounded variable whose data and bounds are subspaced in a consistent manner.

This attribute may be indexed to select a subspace from dimension index values.

Subspacing by indexing

Subspacing by dimension indices uses an extended Python slicing syntax, which is similar numpy array indexing. There are two extensions to the numpy indexing functionality:

  • Size 1 dimensions are never removed.

    An integer index i takes the i-th element but does not reduce the rank of the output array by one.

  • When advanced indexing is used on more than one dimension, the advanced indices work independently.

    When more than one dimension’s slice is a 1-d boolean array or 1-d sequence of integers, then these indices work independently along each dimension (similar to the way vector subscripts work in Fortran), rather than by their elements.

New in version 2.0.

Examples: