cfdm.core.CoordinateConversion.get_parameter

CoordinateConversion.get_parameter(parameter, default=ValueError())[source]

Get a parameter value.

New in version (cfdm): 1.7.0

Parameters
parameter: str

The name of the parameter.

default: optional

Return the value of the default parameter if the parameter has not been set.

If set to an Exception instance then it will be raised instead.

Returns

The value of the parameter.

Examples

>>> f = cfdm.core.CoordinateConversion()
>>> f.set_parameter('earth_radius', 6371007)
>>> f.has_parameter('earth_radius')
True
>>> f.get_parameter('earth_radius')
6371007
>>> f.del_parameter('earth_radius')
6371007
>>> f.has_parameter('earth_radius')
False
>>> print(f.del_parameter('earth_radius', None))
None
>>> print(f.get_parameter('earth_radius', None))
None