cf.Field.direction

Field.direction(identity, axes=None, **kwargs)[source]

Whether or not a domain axis is increasing.

An domain axis is considered to be increasing if its dimension coordinate values are increasing in index space or if it has no dimension coordinate.

See also

directions

Parameters
identity:

Select the domain axis construct by one of:

  • An identity or key of a 1-d coordinate construct that whose data spans the domain axis construct.

  • A domain axis construct identity or key.

  • The position of the domain axis construct in the field construct’s data.

The identity parameter selects the domain axis as returned by this call of the field construct’s domain_axis method: f.domain_axis(identity).

axes: deprecated at version 3.0.0

Use the identity parameter instead.

size: deprecated at version 3.0.0

kwargs: deprecated at version 3.0.0

Returns
bool

Whether or not the domain axis is increasing.

Examples:

>>> print(f.dimension_coordinate('X').array)
array([  0  30  60])
>>> f.direction('X')
True
>>> g = f.flip('X')
>>> g.direction('X')
False