cf.Field.allclose

Field.allclose(y, rtol=None, atol=None)[source]

Returns True if two broadcastable fields have have equal array values to within numerical tolerance.

For numeric data arrays f.allclose(y, atol, rtol) is equivalent to (abs(f - y) <= ``atol + rtol*abs(y)).all(), otherwise it is equivalent to (f == y).all().

See also

equals

Parameters:

y :

atol : float, optional

The absolute tolerance for all numerical comparisons, By default the value returned by the cf.ATOL function is used.

rtol : float, optional

The relative tolerance for all numerical comparisons, By default the value returned by the cf.RTOL function is used.

Returns:
out : bool

Whether or not the two fields’ data arrays are equivalent.

Examples:
>>> f.allclose(g)
True
>>> f.allclose(24)
False
>>> f.allclose(f.data)
True

Previous topic

cf.Field.year

Next topic

cf.Field.anchor

This Page