cf.Constructs.filter_by_ncdim

Constructs.filter_by_ncdim(*ncdims, todict=False, cached=None)[source]

Select domain axis constructs by netCDF dimension name.

New in version (cfdm): 1.7.0

Parameters
ncdims: optional

Select constructs that have a netCDF dimension name, defined by their nc_get_dimension methods, that match any of the given values.

If no netCDF dimension names are provided then all constructs that do or could have a netCDF dimension name are selected.

A value may be any object that can match via the == operator, or a re.Pattern object that matches via its search method.

todict: bool, optional

If True then return a dictionary of constructs keyed by their construct identifiers, instead of a Constructs object. This is a faster option.

New in version (cfdm): 1.8.9.0

cached: optional

If any value other than None then return cached without selecting any constructs.

New in version (cfdm): 1.8.9.0

Returns
Constructs or dict or cached

The selected constructs, or a cached valued.

Examples

Select the domain axis constructs with netCDF dimension name ‘time’:

>>> d = c.filter_by_ncdim('time')

Select the domain axis constructs with netCDF dimension name ‘time’ or ‘lat’:

>>> d = c.filter_by_ncdim('time', 'lat')