cf.DimensionCoordinate.clip

DimensionCoordinate.clip(a_min, a_max, units=None, bounds=True, i=False)[source]

Limit the values in the data array.

Given an interval, values outside the interval are clipped to the interval edges.

Examples 1:
>>> g = f.clip(-90, 90)
Parameters:

a_min: scalar

a_max: scalar

units: str or cf.Units

bounds: bool, optional

If False then do not alter the dimension coordinate’s bounds, if it has any. By default any bounds are also altered.

i: bool, optional

If True then update the dimension coordinate in place. By default a new dimension coordinate is created. In either case, a dimension coordinate is returned.

Returns:

out: cf.DimensionCoordinate

Examples 2:
>>>