hibou.utils.Variable#
Description#
This class (namedtuple actually) stores an array of values and its associated units. It becomes useful when applying MetPy’s functions on arrays. So MetPy can do the calculation on the values without losing the units.
Parameters#
- values
np.array, positionnal-only The array that contains the values, without the units.
- units
Pint.Units, positionnal-only The units of the values in the array.
Note
All the values in the array must have the same units.
Examples#
from metpy.units import units
from hibou.utils import Variable
temperature = Variable(temperature_array, units("degC"))