cf.AncillaryVariables.select

AncillaryVariables.select(match={}, cvalue={}, csize={}, rank=None, exact=False, match_all=True, regex=False, 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 conditions.

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

Parameters :
match : optional

Set conditions on field property values. See the match parameter of cf.Field.match for details.

cvalue : dict, optional

A dictionary which identifies field coordinate objects with corresponding tests on their data array values. See the cvalue parameter of cf.Field.match for details.

csize : dict, optional

A dictionary which identifies field coordinate objects with corresponding tests on their cell sizes. See the csize parameter of cf.Field.match for details.

rank : int or cf.Comparison, optional

Specify a condition on field domain rank, where the domain rank is the number of domain axes. See the rank parameter of cf.Field.match for details.

exact : bool, optional

The exact argument applies to the interpretion of particular conditions given by values of the match argument and by keys of the cvalue and csize arguments. See the exact parameter of cf.Field.match for details.

match_all : bool, optional

The match_all argument applies to the interpretion of all conditions (properties, coordinate object values, coordinate object cell sizes, domain rank and data array rank). See the match_all parameter of cf.Field.match for details.

regex : bool, optional

The regex argument applies to the interpretion of string-valued conditions. See the regex parameter of cf.Field.match for details.

inverse : bool, optional

If True then a field matches field if it does not satisfy the given conditions. By default a field matches field if it satisfies the given conditions.

Returns :
out : cf.FieldList

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

See also

match

Examples

Previous topic

cf.AncillaryVariables.reverse

Next topic

cf.AncillaryVariables.set_equals

This Page