cf.Bounds.identity

Bounds.identity(default='', strict=False, relaxed=False, nc_only=False, relaxed_identity=None)[source]

Return the canonical identity.

By default the identity is the first found of the following:

  1. The “standard_name” property.

  2. The “cf_role” property, preceded by 'cf_role='.

  3. The “long_name” property, preceded by 'long_name='.

  4. The netCDF variable name, preceded by 'ncvar%'.

  5. The value of the default parameter.

Properties include any inherited properties.

New in version 3.0.6.

See also

identities

Parameters
default: optional

If no identity can be found then return the value of the default parameter.

strict: bool, optional

If True then the identity is the first found of only the “standard_name” property or the “id” attribute.

relaxed: bool, optional

If True then the identity is the first found of only the “standard_name” property, the “id” attribute, the “long_name” property or the netCDF variable name.

nc_only: bool, optional

If True then only take the identity from the netCDF variable name.

Returns

The identity.

Examples:

>>> b.inherited_properties()
{'foo': 'bar',
 'long_name': 'Longitude'}
>>> b.properties()
{'long_name': 'A different long name'}
>>> b.identity()
'long_name=A different long name'
>>> b.del_property('long_name')
'A different long name'
>>> b.identity()
'long_name=Longitude'