pcon

cfplot.pcon(mb=None, km=None, h=7.0, p0=1000)[source]
pcon is a function for converting pressure to height in kilometers and
vice-versa. This function uses the equation P=P0exp(-z/H) to translate
between pressure and height. In pcon the surface pressure P0 is set to
1000.0mb and the scale height H is set to 7.0. The value of H can vary
from 6.0 in the polar regions to 8.5 in the tropics as well as
seasonally. The value of P0 could also be said to be 1013.25mb rather
than 1000.0mb.
As this relationship is approximate:
(i) Only use this for making the axis labels on y axis pressure plots
(ii) Put the converted axis on the right hand side to indicate that
this isn't the primary unit of measure
print cfp.pcon(mb=[1000, 300, 100, 30, 10, 3, 1, 0.3])
[0. 8.42780963 16.11809565 24.54590528 32.2361913
40.66400093 48.35428695, 56.78209658]
mb=None - input pressure
km=None - input height
h=7.0 - default value for h
p0=1000 - default value for p0
Returns:
pressure(mb) if height(km) input,
height(km) if pressure(mb) input