CFVariableRegistry.define¶
- CFVariableRegistry.define(name, *args, aliases=None, parents=None, **kwargs)[source]¶
Define a
CFVariable
instance. Inspired bypint.UnitRegistry.define
.- Parameters
name (str) – The registered variable name. The CFVariable property
property
can be retrieved for data arrays whosename
match this name usingdata_array.climo.cfvariable.property
or the shorthand formdata_array.climo.property
.aliases (str or list of str, optional) – Aliases for the
CFVariable
. This can be useful for identifying dataset variables from a wide variety of sources that have emptystandard_name
attributes. As an example you might register an air temperature variablet
withaliases=('ta', 'temp', 'air_temp')
.parents (str or list of str, optional) – The parent variable name(s). Unspecified variable properties are inherited from the first one, and variable grouping is based on all of them. For example, defining the variable
eddy_potential_energy
withparents=('lorenz_energy_budget_term', 'energy_flux')
will yield both'eddy_potential_energy' in vreg['lorenz_energy_budget_term']
and'eddy_potential_energy' in vreg['energy_flux']
.*args, **kwargs – Passed to
CFVariable
.
Notes
If the input variable’s
identifiers
conflict with an existing variable’sidentifiers
, a warning message is printed and the conflicting variable is removed from the registry (along with its children).