cf.Constructs.filter_by_ncdim¶
- Constructs.filter_by_ncdim(*ncdims, todict=False, cached=None)[source]¶
Select domain axis constructs by netCDF dimension name.
Added in version (cfdm): 1.7.0
See also
filter,filters_applied,inverse_filter,clear_filters_applied,unfilter- Parameters:
- ncdims: optional
Select constructs that have a netCDF dimension name, defined by their
nc_get_dimensionmethods, 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 are.Patternobject that matches via itssearchmethod.- todict:
bool, optional If True then return a dictionary of constructs keyed by their construct identifiers, instead of a
Constructsobject. This is a faster option.Added in version (cfdm): 1.8.9.0
- cached: optional
If any value other than
Nonethen return cached without selecting any constructs.Added in version (cfdm): 1.8.9.0
- Returns:
Constructsordictor cachedThe 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')