hydromodpy.data.common.unit_helpers#

Unit conversion helpers backed by hydromodpy.core.units.

Supports multiplicative conversions (length, flow, concentration, radiation, …) and affine conversions (temperature with offset: K, °F ↔ °C).

Functions

convert_array(data, from_unit, to_unit)

Convert array-like data (numpy, pandas, xarray) between compatible units.

convert_value(value, from_unit, to_unit)

Convert a scalar value between compatible units.

get_conversion_factor(from_unit, to_unit)

Return a multiplicative conversion factor between compatible units.