earthsciencekit.units#

Small explicit unit conversions; raw model arguments carry no unit metadata.

earthsciencekit.units.available_units()[source]#

Return a new mapping of supported unit labels to dimension names.

earthsciencekit.units.convert(value, source, target)[source]#

Convert a finite scalar or array between listed compatible units.

Parameters:
  • value (float or array_like) – Quantity in source units. Temperature conversions require nonnegative kelvin.

  • source (str) – Exact case-sensitive unit labels from available_units().

  • target (str) – Exact case-sensitive unit labels from available_units().

Returns:

Quantity in target units. Unknown units or incompatible dimensions fail.

Return type:

numpy scalar or ndarray