parse_units¶
- parse_units(units, /)[source]¶
Translate unit string into
pint
units, with support for CF compliant constructs. This is used withquantify
andto_units
. Includes the following features:Interpret CF standard where exponents are expressed as numbers adjacent to letters without any exponentiation marker, e.g.
m2
form^2
.Interpret CF standard time units, e.g. convert
days since 0001-01-01
todays
.Interpret climopy-defined units with constants without the leading dummy underscore (e.g.
'100km'
instead of'_100km'
; seeureg
for details).Interpret everything to the right of the first slash as part of the denominator. This permits e.g.
W / m2 Pa
instead ofW / m^2 / Pa
; additional slashes after the first slash are optional.