CFVariableRegistry.define

CFVariableRegistry.define(name, *args, aliases=None, parents=None, **kwargs)[source]

Define a CFVariable instance. Inspired by pint.UnitRegistry.define.

Parameters
  • name (str) – The registered variable name. The CFVariable property property can be retrieved for data arrays whose name match this name using data_array.climo.cfvariable.property or the shorthand form data_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 empty standard_name attributes. As an example you might register an air temperature variable t with aliases=('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 with parents=('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’s identifiers, a warning message is printed and the conflicting variable is removed from the registry (along with its children).