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:

>>> f = cfdm.example_field(1)
>>> c = f.get_construct('cellmeasure0')
>>> c.get_measure()
'area'
>>> c.properties()
{'units': 'km2'}
>>> c.nc_get_variable()
'cell_measure'
>>> c.identity(default='no identity')
'measure:area'
>>> c.del_measure()
'area'
>>> c.identity()
'ncvar%cell_measure'
>>> c.nc_del_variable()
'cell_measure'
>>> c.identity()
''
>>> c.identity(default='no identity')
'no identity'