CFVariableRegistry.define¶
- CFVariableRegistry.define(name, *args, aliases=None, parents=None, **kwargs)[source]¶
Define a
CFVariableinstance. Inspired bypint.UnitRegistry.define.- Parameters
name (str) – The registered variable name. The CFVariable property
propertycan be retrieved for data arrays whosenamematch this name usingdata_array.climo.cfvariable.propertyor 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_nameattributes. As an example you might register an air temperature variabletwithaliases=('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_energywithparents=('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
identifiersconflict with an existing variable’sidentifiers, a warning message is printed and the conflicting variable is removed from the registry (along with its children).