CFVariableRegistry.__call__

CFVariableRegistry.__call__(name, accessor=None, longitude=None, latitude=None, vertical=None, time=None, **kwargs)[source]

Return a copy of a variable with optional name and unit modifications based on the coordinate reduction methods and optional pairing to an existing ClimoDataArrayAccessor. Inspired by pint.UnitRegistry.__call__.

Parameters
  • name (str) – The variable name

  • accessor (ClimoDataArrayAccessor) – The accessor (required for certain labels). Automatically passed when requesting the accessor property cfvariable

  • longitude, latitude, vertical, time (optional) – Reduction method(s) for standard CF coordinate axes. Taken from corresponding dimensions in the cell_methods attribute when requesting the accessor property cfvariable.

  • **kwargs – Passed to CFVariable.update. Prefixes and suffixes are applied at the end, while name replacements are applied at the beginning

Note

For integral coordinate reductions, instructions for dealing with unit changes must be hardcoded in this function. So far this is done for energy budget, momentum budget, and Lorenz budget terms and their children.

Todo

Add non-standard wavenumber, frequency, and ensemble dimension options. We’re already using non-standard reduction methods, so this isn’t a stretch.