cf.CoordinateReference.equivalent

CoordinateReference.equivalent(other, atol=None, rtol=None, verbose=None, traceback=False)[source]

True if two coordinate references are logically equal, False otherwise.

Parameters
other: cf.CoordinateReference

The object to compare for equality.

atol: number, optional

The tolerance on absolute differences between real numbers. The default value is set by the cf.atol function.

rtol: number, optional

The tolerance on relative differences between real numbers. The default value is set by the cf.rtol function.

verbose: int or str or None, optional

If an integer from -1 to 3, or an equivalent string equal ignoring case to one of:

  • 'DISABLE' (0)

  • 'WARNING' (1)

  • 'INFO' (2)

  • 'DETAIL' (3)

  • 'DEBUG' (-1)

set for the duration of the method call only as the minimum cut-off for the verboseness level of displayed output (log) messages, regardless of the globally-configured cf.log_level. Note that increasing numerical value corresponds to increasing verbosity, with the exception of -1 as a special case of maximal and extreme verbosity.

Otherwise, if None (the default value), output messages will be shown according to the value of the cf.log_level setting.

Overall, the higher a non-negative integer or equivalent string that is set (up to a maximum of 3/'DETAIL') for increasing verbosity, the more description that is printed to convey information about the operation.

traceback: deprecated at version 3.0.0

Use the verbose parameter instead.

Returns
out: bool

Whether or not the two objects are equivalent.

Examples

>>> a = cf.example_field(6)
>>> b = cf.example_field(7)
>>> r = a.coordinate_reference('coordinatereference0')
>>> s = b.coordinate_reference('coordinatereference0')
>>> r.equivalent(r)
True
>>> r.equivalent(s)
False
>>> s.equivalent(r)
False
>>> s.equivalent(s)
True