Calculate mixing ratio \(w\) (g/kg) from vapor pressure \(e\) (hPa) and air pressure \(p\) (hPa).
Details
Mixing ratio \(w\) (g/kg) is defined as the mass of moisture per mass of dry air:
$$q = \frac{0.622 \cdot e \cdot 1000}{p - e}$$
where \(e\) is the vapor pressure (hPa), and \(p\) is the air pressure (hPa).
References
Davis, Robert E., Glenn R. McGregor, and Kyle B. Enfield. “Humidity: A Review and Primer on Atmospheric Moisture and Human Health.” Environmental Research 144 (January 2016): 106–16. https://doi.org/10.1016/j.envres.2015.10.014.