cf.Query.Units¶
-
Query.
Units
¶ Return the units of the query.
New in version 3.15.2.
- Returns
Units
The units of the query value.
Examples
>>> cf.eq(9).Units <Units: > >>> cf.eq(9, 'm s-1').Units <Units: m s-1> >>> cf.eq(cf.Data(9, 'km')).Units <Units: km>
>>> (cf.eq(9) | cf.gt(10)).Units <Units: > >>> (cf.eq(9, 'm') | cf.gt(10, 'm')).Units <Units: > >>> (cf.eq(9, 'm') | cf.gt(9, 'm')).Units <Units: m> >>> (cf.eq(9, 'm') | cf.gt(45)).Units <Units: m>
>>> (cf.eq(9, 'm') | cf.gt(9, 'day')).Units AttributeError: <CF Query: [(eq 9 m) | (gt 9 day)]> has indeterminate units