1. admeteopy

Download and install

Download the latest version as gzipped tarball and (for Linux) untar and install as root:

tar -xvzf adrasolib<-x.y.z-yyyy-mm-dd>.tar.gz
cd admeteop<-x.y.z-yyyy-mm-dd>
sudo python setup.py install

Now the module can be used in python scripts by

import admeteopy

The module has never been tested with Windows, but it should work.

Meteorological constants and functions

Based on earlier versions of the module dating back to 2009.

© Dietmar Thaler 2009-2018

Note

This module makes use of the numpy lybrary. NumPy is the fundamental package for scientific computing with Python. Make sure you have it installed. See http://www.numpy.org/ and http://sourceforge.net/projects/numpy/


This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License. If not, see <http://www.gnu.org/licenses/gpl.html> .


admeteopy.c2k(tk)[source]

Converts temperature in Celsius to temperature in Kelvin

admeteopy.celsius2kelvin(tc)[source]

Converts temperature in Celsius to temperature in Kelvin

admeteopy.e_ice(t=0.0)[source]

Saturation water vapor over a plane frozen water (ice) surface (according http://cires.colorado.edu/~voemel/vp.html or http://cires.colorado.edu/~voemel/vp.html “Guide to Meteorological Instruments and Methods of Observation”, CIMO Guide, WMO 2008)

t … temperature t in C
e_ice … sat. water vapor in hPa
admeteopy.e_pot_temp(T, p, m)[source]

Equivalent potential temperature K

T … Temp in K
p … pressure in hPa
m … mixing ration in kg/kg (!)
e_pot_temp … equivalent potential temp. in K
admeteopy.e_pot_temp_bolton(Tk, Tl, p, m)[source]

Equivalent potential temperature K after Bolton(1980): The Computation of Eqivalent Potential Temperature (MWR Vol.108)

Tk … Temp in the starting level of ascend in K
Tl … Temp. in the lifting condensation level in K
p … pressure in hPa
m … mixing ration in kg/kg (!)
e_pot_temp_bolton … equivalent potential temp. in K
admeteopy.e_stefan_boltzmann(T, eps=1.0)[source]

Radiation flux density of a black or grey body (Stefan-Boltzmann law)

T …. temperature of the body [K]
eps .. emissivity <= 1, defaults to 1
e_stefan_boltzmann … emitted radiation flux density W/m^2/K^4
admeteopy.e_water(t=0.0)[source]

Saturation water vapor over a plane liqid water surface (according http://cires.colorado.edu/~voemel/vp.html or http://cires.colorado.edu/~voemel/vp.html Guide to Meteorological Instruments and Methods of Observation, CIMO Guide, WMO 2008)

t … temperature t in C
e_water … sat. water vapor in hPa
admeteopy.g_welmec(phi=45.0, z=0.0)[source]

WELMEC-formula for the caculation of gravity as function of latitude and height

phi … latitude in decimal grade (positive north)
z … height in meter
g_welmec… gravity in m/s^2
admeteopy.gpotheight(phi=45.0, z=0.0)[source]

Geopotential (ICAO-) height according to the WELMEC-formula for the caculation of gravity as function of latitude and height. gp(z) = integral(g(z)dz) from ground with z=0 to height z.

phi … latitude in decimal grade (positive north)
z … height in meter
gpotheight … geopotential in units of g0 (ICAO)
admeteopy.k2c(tk)[source]

Converts temperature in Kelvin to temperature in Ceslius

admeteopy.kelvin2celsius(tk)[source]

Converts temperature in Kelvin to temperature in Ceslius

admeteopy.l_evw(t=0.0)[source]

Latent heat of evaporation/condensation of water (vapor - liquid) valid from -40 to +40 C.

Cubic fit to Table 2.1,p.16, Textbook: R.R.Rogers & M.K. Yau, A Short Course in Cloud Physics, 3e,(1989), Pergamon press http://en.wikipedia.org/wiki/Latent_heat (2009-11-09) V 2009-11-09, (p) dietmar.thaler@gmx.at

T .. Temperature in C
l_evw .. Latent heat in J/kg as function of Temperature
admeteopy.m_mixingratio(e, p)[source]

mixing ratio as function of water-vapor pressure and air pressure

e … vapor pressur
p … air pressure
m_mixingratio … mixing ratio in kg/kg
admeteopy.p0_wmocimo2008(ps, Hp, ts, es)[source]

Pressure reduction to mean sealevel according to WMO CIMO Guide, Part I, Chapter 3 (Edition 2008, updated in 2010) http://www.wmo.int/pages/prog/www/IMOP/CIMO-Guide.html

ps … station pressure
Hp … station height in geopotential meter (local gravity correction)
ts … station temperature in C
es … station vapor presser in hPa
admeteopy.p_iso(p0, T0, z, g=9.80665)[source]

Isothermal atmosphere - pressure reduction

p0 .. pressure at level 0
T0 .. temperature in K
z .. thickness level in [m]
g .. gravity, defaults to g0
p_iso .. pressure at level z
admeteopy.p_poly(p0, T0, z, gamma, g=9.80665)[source]

Polytropic atmosphere - pressure reduction

p0 .. pressure at level 0
T0 .. temperature in K
z .. thickness level in [m]
gamma = -dT/dz .. vertical temperature gradient [K/m]
g .. gravity, defaults to standard gravity g0
p_poly .. pressure at level z
admeteopy.planck_black_body_fr(T, nu, eps=1.0)[source]

Planck thermal radiance as a function of

T … temparature of the body [K]
nu … frequency [Hz]
eps … spectral emissivity, 0 =< eps <=1
admeteopy.planck_black_body_wl(T, lam, eps=1.0)[source]

Planck thermal radiance as a function of

T … temparature of the body [K]
lam … wavelenghth [m]
eps … spectral emissivity, 0 =< eps <=1
admeteopy.pot_temp(T, p)[source]

Potential temperatur as function of temperature and pressure (reduction to ps=1000.0 hpa)

T .. temperatur of dry air [K]
p .. pressure of air [hPa !!!]
pot_temp .. pot. Temp. [K]
admeteopy.q_spechum(e, p)[source]

Specific humidity as function of water-vapor pressure and air pressure

e … vapor pressure
p … air pressure
q_spechum … specific humidity in kg/kg
admeteopy.sat_mixingratio_water(T, p)[source]

Saturation mixing ratio as function of temperature and air pressure

T … Temperature in C
p … Pressure in hPa
sat_mixingratio_water .. Saturation mixing ratio
admeteopy.showalter_index_bolton1(t_lower, t_upper, td_lower, p_lower=850.0, p_upper=500.0)[source]

Showalter index [C] as a function of pressure, temperature and dewpoint at the lower level and pressure and temperature at the upper level. Calculation is done according to Bolton(1980): “The Computation of Eqivalent Potential Temperature” (MWR Vol.108). Terminates with an error message when there is no convergence within 100 iterations.

t_lower … temperature at p_lower in C
t_upper … temperature at p_upper in C
td_lower … dewpoint temperature at p_lower in C
p_lower … pressure at the lower level in hPa
p_upper … pressure at the upper level in hPa
showalter_index_bolton1 … Showalter Index (SWI) in C

SWI = Temp at the upper level - Showalter temperature for the upper level

admeteopy.showalter_temperature_bolton1(ThetaE, p, tswi)[source]

Showalter temperature [C] as a function of the eqivalent-potential temperature according to Bolton(1980): “The Computation of Eqivalent Potential Temperature” (MWR Vol.108) and pressure. Terminates with an error message when there is no convergence within 100 iterations.

ThetaE … equivalent (pseudo-) potential temp.
p … pressure in hPa
tswi … start value for the Showalter temperature as 0th-approximation [C]
showalter_temperature_bolton1 … Showalter temperature [C]
admeteopy.t_lifting_condensation_level_bolton1(Tk, Td)[source]

Lifting condensation according to Bolton(1980): “The Computation of Eqivalent Potential Temperature” (MWR Vol.108)

Tk … Temp in the starting level of ascend in K
Td … Dewpoint Temp. in the starting in the starting level of ascend in K
p … pressure in hPa
m … mixing ration in kg/kg (!)
t_lifting_condensation_level_bolton1 … lift. condens.level in K
admeteopy.t_virt(T, q)[source]

Virtual Temperatur as function of air temperature and spezific humidity

T … air temperature [K]
q … spezific humidity [kg/kg]
t_virt … virtual temperature [K]
admeteopy.t_virt2(t, td, p)[source]

Virtual Temperature as function of temp., dewpoint and pressure

t … temp. in C(!)
td … dewpoint temp. in C(!)
p … air pressure in hPa
t_virt2 … virtual temp. in K(!)
admeteopy.z_iso(T0, p0, p1, g=9.80665)[source]

Isothermal atmosphere - thickness

p0 .. pressure at level 0
p1 .. pressure at level 1
T0 .. temperature in K
g .. gravity, defaults to standard gravity g0
z_iso .. thickness between level 1 an 0 in [m]
admeteopy.z_poly(T0, p0, p1, gamma, g=9.80665)[source]

Polytropic atmosphere - thickness

p0 .. pressure at level 0
p1 .. pressure at level 1
T0 .. temperature in K
gamma=-dT/dz .. vertical temperature gradient [K/m]
g .. gravity, defaults to standard gravity g0
z_poly .. thickness between level 1 an 0 in [m]
admeteopy.z_poly2(T0, p0, T1, p1, g=9.80665)[source]

Polytropic atmosphere - thickness

p0 .. pressure at level 0
p1 .. pressure at level 1
T0 .. temperature in K in level 0
T1 .. temperature in K in level 1
g .. gravity, defaults to standard gravity g0
z_poly2 .. thickness between level 1 an 0 in [gpm]