cf.Constructs.filter_by_type

Constructs.filter_by_type(*types)[source]

Select metadata constructs by type.

New in version 1.7.0.

Parameters
types: optional

Select constructs that have are of any of the given types.

A type is specified by one of the following strings:

type

Construct selected

'domain_ancillary'

Domain ancillary constructs

'dimension_coordinate'

Dimension coordinate constructs

'domain_axis'

Domain axis constructs

'auxiliary_coordinate'

Auxiliary coordinate constructs

'cell_measure'

Cell measure constructs

'coordinate_reference'

Coordinate reference constructs

'cell_method'

Cell method constructs

'field_ancillary'

Field ancillary constructs

If no types are provided then all constructs are selected.

Returns
Constructs

The selected constructs and their construct keys.

Examples:

Select dimension coordinate constructs:

>>> d = c.filter_by_type('dimension_coordinate')

Select dimension coordinate and field ancillary constructs:

>>> d = c.filter_by_type('dimension_coordinate', 'field_ancillary')