easyclimate.physics.transfer

Unit conversion for Meteorological variables

Functions

transfer_mixing_ratio_2_specific_humidity(...)

Calculate the specific humidity from mixing ratio.

transfer_specific_humidity_2_mixing_ratio(...)

Calculate the mixing ratio from specific humidity.

transfer_dewpoint_2_specific_humidity(→ xarray.DataArray)

Calculate the specific humidity from the dew point temperature and pressure.

transfer_dewpoint_2_mixing_ratio(dewpoint_data, ...)

Calculate the mixing ratio from the dew point temperature and pressure.

transfer_specific_humidity_2_dewpoint(→ xarray.DataArray)

Calculate the dew point temperature from specific humidity and pressure.

transfer_dewpoint_2_relative_humidity(→ xarray.DataArray)

Calculate the relative humidity from dew point temperature.

transfer_mixing_ratio_2_relative_humidity(...)

Calculate the relative humidity from mixing ratio, temperature, and pressure.

transfer_specific_humidity_2_relative_humidity(...)

Calculate the relative humidity from specific humidity, temperature, and pressure.

transfer_relative_humidity_2_dewpoint(→ xarray.DataArray)

Calculate dew point temperature from temperature and relative humidity.

Module Contents

easyclimate.physics.transfer.transfer_mixing_ratio_2_specific_humidity(mixing_ratio_data: xarray.DataArray, mixing_ratio_data_units: Literal['kg/kg', 'g/g', 'g/kg']) xarray.DataArray

Calculate the specific humidity from mixing ratio.

Parameters

mixing_ratio_data: xarray.DataArray.

The mixing ratio of a gas.

mixing_ratio_data_units: str.

The unit corresponding to mixing_ratio_data value. Optional values are \(\mathrm{kg/kg}\), \(\mathrm{g/g}\), \(\mathrm{g/kg}\) and so on.

Returns

The specific humidity, dimensionless (e.g. \(\mathrm{kg/kg}\), \(\mathrm{g/g}\)).

xarray.DataArray.

easyclimate.physics.transfer.transfer_specific_humidity_2_mixing_ratio(specific_humidity_data: xarray.DataArray, specific_humidity_data_units: Literal['kg/kg', 'g/g', 'g/kg']) xarray.DataArray

Calculate the mixing ratio from specific humidity.

Parameters

specific_humidity_data: xarray.DataArray.

The Specific humidity of air.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are \(\mathrm{kg/kg}\), \(\mathrm{g/g}\), \(\mathrm{g/kg}\) and so on.

Returns

The mixing ratio, dimensionless (e.g. \(\mathrm{kg/kg}\), \(\mathrm{g/g}\)).

xarray.DataArray.

easyclimate.physics.transfer.transfer_dewpoint_2_specific_humidity(dewpoint_data: xarray.DataArray, pressure_data: xarray.DataArray, dewpoint_data_units: Literal['celsius', 'kelvin', 'fahrenheit'], pressure_data_units: Literal['hPa', 'Pa', 'mbar']) xarray.DataArray

Calculate the specific humidity from the dew point temperature and pressure.

Parameters

dewpoint_data: xarray.DataArray.

The dew point temperature.

pressure_data: xarray.DataArray.

The pressure data set.

dewpoint_data_units: str.

The unit corresponding to dewpoint_data value. Optional values are celsius, kelvin, fahrenheit.

pressure_data_units: str.

The unit corresponding to pressure_data value. Optional values are hPa, Pa.

Returns

The specific humidity, dimensionless (e.g. \(\mathrm{kg/kg}\), \(\mathrm{g/g}\)).

xarray.DataArray.

easyclimate.physics.transfer.transfer_dewpoint_2_mixing_ratio(dewpoint_data: xarray.DataArray, pressure_data: xarray.DataArray, dewpoint_data_units: Literal['celsius', 'kelvin', 'fahrenheit'], pressure_data_units: Literal['hPa', 'Pa', 'mbar'])

Calculate the mixing ratio from the dew point temperature and pressure.

Parameters

dewpoint_data: xarray.DataArray.

The dew point temperature.

pressure_data: xarray.DataArray.

The pressure data set.

dewpoint_data_units: str.

The unit corresponding to dewpoint_data value. Optional values are celsius, kelvin, fahrenheit.

pressure_data_units: str.

The unit corresponding to pressure_data value. Optional values are hPa, Pa.

Returns

The mixing ratio, dimensionless (e.g. \(\mathrm{kg/kg}\), \(\mathrm{g/g}\)).

xarray.DataArray.

easyclimate.physics.transfer.transfer_specific_humidity_2_dewpoint(specific_humidity_data: xarray.DataArray, pressure_data: xarray.DataArray, specific_humidity_data_units: Literal['kg/kg', 'g/g', 'g/kg'], pressure_data_units: Literal['hPa', 'Pa', 'mbar'], epsilon: float = 0.6219569100577033) xarray.DataArray

Calculate the dew point temperature from specific humidity and pressure.

Parameters

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

pressure_data: xarray.DataArray.

The pressure data set.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are \(\mathrm{kg/kg}\), \(\mathrm{g/g}\), \(\mathrm{g/kg}\) and so on.

pressure_data_units: str.

The unit corresponding to pressure_data value. Optional values are hPa, Pa.

epsilon: float.

The molecular weight ratio, which is molecular weight of the constituent gas to that assumed for air. Defaults to the ratio for water vapor to dry air. (\(\epsilon \approx 0.622\))

Returns

The dew point temperature ( \(\mathrm{degC}\) ).

xarray.DataArray.

easyclimate.physics.transfer.transfer_dewpoint_2_relative_humidity(temperature_data: xarray.DataArray, dewpoint_data: xarray.DataArray, temperature_data_units: Literal['celsius', 'kelvin', 'fahrenheit'], dewpoint_data_units: Literal['celsius', 'kelvin', 'fahrenheit']) xarray.DataArray

Calculate the relative humidity from dew point temperature.

Uses temperature and dew point temperature to calculate relative humidity as the ratio of vapor pressure to saturation vapor pressures.

Parameters

temperature_data: xarray.DataArray.

Atmospheric temperature.

dewpoint_data: xarray.DataArray.

The dew point temperature.

temperature_data_units: str.

The unit corresponding to temperature_data value. Optional values are celsius, kelvin, fahrenheit.

dewpoint_data_units: str.

The unit corresponding to dewpoint_data value. Optional values are celsius, kelvin, fahrenheit.

Returns

The relative humidity, dimensionless.

xarray.DataArray.

easyclimate.physics.transfer.transfer_mixing_ratio_2_relative_humidity(pressure_data: xarray.DataArray, temperature_data: xarray.DataArray, mixing_ratio_data: xarray.DataArray, pressure_data_units: Literal['hPa', 'Pa', 'mbar'], temperature_data_units: Literal['celsius', 'kelvin', 'fahrenheit'], mixing_ratio_data_units: Literal['kg/kg', 'g/g', 'g/kg'], epsilon: float = 0.6219569100577033) xarray.DataArray

Calculate the relative humidity from mixing ratio, temperature, and pressure.

Parameters

pressure_data: xarray.DataArray.

The pressure data set.

temperature_data: xarray.DataArray.

Atmospheric temperature.

mixing_ratio_data: xarray.DataArray.

The mixing ratio of a gas.

pressure_data_units: str.

The unit corresponding to pressure_data value. Optional values are hPa, Pa.

temperature_data_units: str.

The unit corresponding to temperature_data value. Optional values are celsius, kelvin, fahrenheit.

mixing_ratio_data_units: str.

The unit corresponding to mixing_ratio_data value. Optional values are \(\mathrm{kg/kg}\), \(\mathrm{g/g}\), \(\mathrm{g/kg}\) and so on.

epsilon: float.

The molecular weight ratio, which is molecular weight of the constituent gas to that assumed for air. Defaults to the ratio for water vapor to dry air. (\(\epsilon \approx 0.622\))

Returns

The relative humidity, dimensionless.

xarray.DataArray.

easyclimate.physics.transfer.transfer_specific_humidity_2_relative_humidity(pressure_data: xarray.DataArray, temperature_data: xarray.DataArray, specific_humidity_data: xarray.DataArray, pressure_data_units: Literal['hPa', 'Pa', 'mbar'], temperature_data_units: Literal['celsius', 'kelvin', 'fahrenheit'], specific_humidity_data_units: Literal['kg/kg', 'g/g', 'g/kg']) xarray.DataArray

Calculate the relative humidity from specific humidity, temperature, and pressure.

Parameters

pressure_data: xarray.DataArray.

The pressure data set.

temperature_data: xarray.DataArray.

Atmospheric temperature.

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

pressure_data_units: str.

The unit corresponding to pressure_data value. Optional values are hPa, Pa.

temperature_data_units: str.

The unit corresponding to temperature_data value. Optional values are celsius, kelvin, fahrenheit.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are \(\mathrm{kg/kg}\), \(\mathrm{g/g}\), \(\mathrm{g/kg}\) and so on.

Returns

The relative humidity, dimensionless.

xarray.DataArray.

easyclimate.physics.transfer.transfer_relative_humidity_2_dewpoint(relative_humidity_data: xarray.DataArray, temperature_data: xarray.DataArray, relative_humidity_data_units: Literal['%', 'dimensionless'], temperature_data_units: Literal['celsius', 'kelvin', 'fahrenheit']) xarray.DataArray

Calculate dew point temperature from temperature and relative humidity.

The dew point temperature given temperature and relative humidity using the equations from John Dutton’s “Ceaseless Wind” (pp 273-274). Missing values are ignored.

The dew point temperature \(T_d\) (in Kelvin) is calculated from temperature \(T\) and relative humidity \(RH\) using the formula:

\[T_d = \frac{T \cdot L}{L - T \cdot \ln(RH/100)}, \quad \text{where} \quad L = \frac{597.3 - 0.57(T - 273.0)}{GCX} \quad \text{and} \quad GCX = \frac{461.5}{4186}.\]

Parameters

relative_humidity_data: xarray.DataArray.

The relative humidity.

temperature_data: xarray.DataArray.

Atmospheric temperature.

relative_humidity_data_units: str.

The unit corresponding to vapor_pressure_data value. Optional values are %, dimensionless.

temperature_data_units: str.

The unit corresponding to temperature_data value. Optional values are celsius, kelvin, fahrenheit.

Returns

dewpointxarray.DataArray ( \(\mathrm{K}\) )

Dew point temperature.

Reference