cf.CellMeasure.getprop

CellMeasure.getprop(prop, *default)[source]

Get a CF property.

When a default argument is given, it is returned when the attribute doesn’t exist; without it, an exception is raised in that case.

Parameters :
prop : str

The name of the property to get.

default : optional

Return default if and only if the variable does not have the named property.

Returns :
out :

The value of the named property, or the default value.

Raises :
AttributeError :

If the variable does not have the named property and a default value has not been set.

Examples

>>> f.getprop('standard_name')
>>> f.getprop('standard_name', None)
>>> f.getprop('foo')
AttributeError: Field doesn't have CF property 'foo'
>>> f.getprop('foo', 'bar')
'bar'

Previous topic

cf.CellMeasure.flip

Next topic

cf.CellMeasure.hasprop

This Page