cf.DimensionCoordinate.direction

DimensionCoordinate.direction()[source]

Return True if a coordinate is increasing, otherwise return False.

A coordinate is 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 positive property
  • The units property (True if pressure, False otherwise or if missing)
Returns :
out : bool

Whether or not the coordinate is increasing.

Examples

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

Previous topic

cf.DimensionCoordinate.delprop

Next topic

cf.DimensionCoordinate.dump

This Page