cf.Data.clip

Data.clip(a_min, a_max, units=None, i=False)[source]

Clip (limit) the values in the data array in place.

Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified then values smaller than 0 become 0 and values larger than 1 become 1.

Parameters :

a_min : scalar

a_max : scalar

units : str or Units

i : bool, optional
If True then update the data array in place. By default a new data array is created.
Returns :out : cf.Data

Examples

Previous topic

cf.Data.chunk

Next topic

cf.Data.close

This Page