cf.FieldList.select

FieldList.select(match=None, items=None, rank=None, ndim=None, exact=False, match_all=True, inverse=False)[source]

Return the fields which satisfy the given conditions.

The conditions are defined in the same manner as for cf.Field.match, which tests whether or not a field satisfies the given criteria.

Note that fl.select() is equivalent to cf.FieldList(f for f in fl if f.match()).

See also

cf.Field.match, match

Parameters:
match : optional

Set conditions on the field’s CF property and attribute values. See the match parameter of cf.Field.match for details.

items : dict, optional

A dictionary which identifies domain items of the field (dimension coordinate, auxiliary coordinate, cell measure or coordinate reference objects) with corresponding tests on their elements. See the items parameter of cf.Field.match for details.

rank : int or cf.Query, optional

Specify a condition on the number of axes in the field’s domain. See cf.Field.match for details.

ndim : int or cf.Query, optional

Specify a condition on the number of axes in the field’s data array. See cf.Field.match for details.

exact : bool, optional

The exact parameter applies to the interpretation of string values of the match parameter and of keys of the items parameter. See the exact parameter of cf.Field.match for details.

match_and : bool, optional

By default match_and is True and the field matches if it satisfies the conditions specified by each test parameter (match, items, rank and ndim). If match_and is False then the field will match if it satisfies at least one test parameter’s condition. See the match_and parameter of cf.Field.match for details.

inverse : bool, optional

If True then return the field matches if it does not satisfy the given conditions. See the inverse parameter of cf.Field.match for details.

Returns:
out : cf.FieldList

Each field that matches the given conditions, or if inverse is True, doesn’t match the conditions.

Examples:

Previous topic

cf.FieldList.sd

Next topic

cf.FieldList.set_equals

This Page