cf.CellMeasure.name

CellMeasure.name(default=None, identity=False)[source]

Return a name for the cell measure.

Returns the the first found of:

  • The measure attribute.
  • The standard_name CF property.
  • The id attribute.
  • If the identity parameter is False, the long_name CF property, preceeded by the string 'long_name:'.
  • If the identity parameter is False, the ncvar attribute, preceeded by the string 'ncvar:'.
  • The value of the default parameter.

Note that c.name(identity=True) is equivalent to c.identity().

Parameters :
default : optional

If no name can be found then return the value of the default parameter. By default the default is None.

identity : bool, optional

If True then only return ....

Returns :
out : str

A name for the variable.

See also

identity

Examples

>>> f.standard_name = 'air_temperature'
>>> f.long_name = 'temperature of the air'
>>> f.ncvar = 'tas'
>>> f.name()
'air_temperature'
>>> del f.standard_name
>>> f.name()
'long_name:temperature of the air'
>>> del f.long_name
>>> f.name()
'ncvar:tas'
>>> del f.ncvar
>>> f.name()
None
>>> f.name('no_name')
'no_name'
>>> f.standard_name = 'air_temperature'
>>> f.name('no_name')
'air_temperature'

Previous topic

cf.CellMeasure.match

Next topic

cf.CellMeasure.override_units

This Page