parse_units

parse_units(units, /)[source]

Translate unit string into pint units, with support for CF compliant constructs. This is used with quantify and to_units. Includes the following features:

  • Interpret CF standard where exponents are expressed as numbers adjacent to letters without any exponentiation marker, e.g. m2 for m^2.

  • Interpret CF standard time units, e.g. convert days since 0001-01-01 to days.

  • Interpret climopy-defined units with constants without the leading dummy underscore (e.g. '100km' instead of '_100km'; see ureg for details).

  • Interpret everything to the right of the first slash as part of the denominator. This permits e.g. W / m2 Pa instead of W / m^2 / Pa; additional slashes after the first slash are optional.