cf.Constructs.filter_by_ncdim

Constructs.filter_by_ncdim(*ncdims)[source]

Select domain axis constructs by netCDF dimension name.

New in version 1.7.0.

Parameters
ncdims: optional

Select domain axis constructs that have any of the given netCDF dimension names.

A netCDF dimension name is specified by a string (e.g. 'time'); or a compiled regular expression (e.g. re.compile('^lat')), for which all constructs whose netCDF dimension names match (via re.search) are selected.

If no netCDF dimension names are provided then all domain axis constructs are selected.

Returns
Constructs

The selected domain axis constructs and their construct keys.

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')