cf.DimensionCoordinate.direction

DimensionCoordinate.direction()[source]

Return True if the dimension coordinate values are increasing, otherwise return False.

Dimension coordinates values are increasing if its coordinate values are increasing in index space.

The direction is inferred from one of, in order of precedence:

  • The data array

  • The bounds data array

  • The units CF property

Returns
bool

Whether or not the coordinate is increasing.

Examples

>>> c.array
array([  0  30  60])
>>> c.direction()
True
>>> c.bounds.array
array([  30  0])
>>> c.direction()
False