cf.DimensionCoordinate.get_bounds

DimensionCoordinate.get_bounds(create=False, insert=False, bound=None)[source]

Find the dimension coordinate’s bounds.

Either return its existing bounds or, if there are none, optionally create bounds based on the coordinate’s array values.

Parameters :
create : bool, optional

If True then create bounds if and only if the the dimension coordinate does not already have them. Voronoi bounds are created unless bound is set. By default an exception is raised if the coordinate does not have bounds.

insert : bool, optional

If True then insert the created bounds into the coordinate in place. By default the created bounds are not inserted. Ignored if create is not True.

bound : optional

If set to an upper or lower bound for the whole array, then create bounds which include this value and for which each array element is in the centre of its bounds. By default Voronoi bounds are created. Ignored if create is not True.

Returns :
out : cf.CoordinateBounds

The existing or created bounds.

Examples

>>> c.get_bounds()
>>> c.get_bounds(create=True)
>>> c.get_bounds(create=True, bound=-60)
>>> c.get_bounds(create=True, insert=True)

Previous topic

cf.DimensionCoordinate.flip

Next topic

cf.DimensionCoordinate.getattr

This Page