cfdm.Domain.get_construct

Domain.get_construct(key, default=ValueError())[source]

Return a metadata construct.

New in version (cfdm): 1.7.0

Parameters
key: str

The key of the metadata construct.

Parameter example:

key='domainaxis1'

default: optional

Return the value of the default parameter if the construct does not exist.

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

Returns

The metadata construct.

Examples

>>> f.constructs()
{'auxiliarycoordinate0': <AuxiliaryCoordinate: latitude(10, 9) degree_N>,
 'auxiliarycoordinate1': <AuxiliaryCoordinate: longitude(9, 10) degreeE>,
 'auxiliarycoordinate2': <AuxiliaryCoordinate: long_name:greek_letters(10) >,
 'coordinatereference1': <CoordinateReference: rotated_latitude_longitude>,
 'dimensioncoordinate1': <DimensionCoordinate: grid_latitude(10) degrees>,
 'dimensioncoordinate2': <DimensionCoordinate: grid_longitude(9) degrees>,
 'domainaxis1': <DomainAxis: 10>,
 'domainaxis2': <DomainAxis: 9>}
>>> f.get_construct('dimensioncoordinate1')
<DimensionCoordinate: grid_latitude(10) degrees>