cf.DimensionCoordinate.get_bounds

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

Get the cell bounds.

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

Parameters:
create : bool, optional

If True then create bounds if and only if the the dimension coordinate does not already have them. Bounds for Voronoi cells are created unless bound is set.

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 bounds are created which include this value and for which each array element is in the centre of its bounds. By default bounds for Voronoi cells are created. Ignored if create is not True.

copy : bool, optional

If False then the returned bounds are not independent of the existing bounds, if any, or those inserted, if create and insert are both True. By default the returned bounds are independent.

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)
>>> c.get_bounds(create=True, bound=-9000.0, insert=True, copy=False)