mixing_ratio2specific_humidity

typhon.physics.mixing_ratio2specific_humidity(w)[source]

Convert mass mixing ratio to specific humidity.

\[q = \frac{w}{1 + w}\]
Parameters:

w (float or ndarray) – Mass mixing ratio.

Returns:

Specific humidity.

Return type:

float or ndarray

Examples

>>> mixing_ratio2specific_humidity(0.02)
0.0196078431372549