cf.FieldAncillary.allclose¶
-
FieldAncillary.allclose(y, atol=None, rtol=None)[source]¶ Test whether all data are element-wise equal to other, broadcastable data.
Two real numbers
xandyare considered equal if|x-y|<=atol+rtol|y|, whereatol(the tolerance on absolute differences) andrtol(the tolerance on relative differences) are positive, typically very small numbers. See the atol and rtol parameters.- Parameters
- y:
The object to be compared with the data array. y must be broadcastable to the data array and if y has units then they must be compatible. May be any object that can be converted to a
Dataobject (which includes numpy array andDataobjects).- atol:
float, optional The tolerance on absolute differences between real numbers. The default value is set by the
atolfunction.- rtol:
float, optional The tolerance on relative differences between real numbers. The default value is set by the
rtolfunction.
- Returns
Examples
>>> x = f.allclose(g)