cfdm.CellMeasure.identity

CellMeasure.identity(default='')[source]

Return the canonical identity.

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

  • The measure, preceded by 'measure:'.

  • The standard_name property.

  • The cf_role property, preceded by ‘cf_role=’.

  • The long_name property, preceded by ‘long_name=’.

  • The netCDF variable name, preceded by ‘ncvar%’.

  • The value of the default parameter.

New in version (cfdm): 1.7.0

See also

identities

Parameters
default: optional

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

Returns

The identity.

Examples:

>>> c.get_measure()
'area'
>>> c.properties()
{'long_name': 'Area',
 'standard_name': 'cell_area'}
>>> c.nc_get_variable()
'areacello'
>>> c.identity(default='no identity')
'measure:area'
>>> c.del_measure()
'area'
>>> c.identity()
'cell_area'
>>> c.del_property('standard_name')
'cell_area'
>>> c.identity()
'long_name=Area'
>>> c.del_properly('long_name')
'Area'
>>> c.identity()
'ncvar%areacello'
>>> c.nc_del_variable()
'areacello'
>>> c.identity()
''
>>> c.identity(default='no identity')
'no identity'