cf.CoordinateReference.has_coordinate

CoordinateReference.has_coordinate(key)[source]

Whether a reference to a coordinate construct has been set.

New in version (cfdm): 1.7.0

Parameters
key: str

The construct key of the coordinate construct.

Parameter example:

key='dimensioncoordinate1'

Parameter example:

key='auxiliarycoordinate0'

Returns
bool

True if the coordinate construct key has been set, otherwise False.

Examples

>>> r = cf.CoordinateReference()
>>> r.set_coordinates(['dimensioncoordinate0', 'auxiliarycoordinate1'])
>>> r.coordinates()
{'auxiliarycoordinate1', 'dimensioncoordinate0'}
>>> r.has_coordinate('dimensioncoordinate0')
True
>>> r.has_coordinate('dimensioncoordinate1')
False