epygram.profiles — Functions on vertical profiles
This module contains functions to:
- to convert vertical coordinates systems from the one to another;
- compute air specific gas constant R according to specific humidity
and hydrometeors.
- to plot vertical profiles.
Conversion
-
epygram.profiles.hybridP2fluxpressure(A, B, Psurf)
Computes the pressure at flux levels defined by hybrid-pressure
coefficients. Coefficients are assumed to define flux levels.
- A = table of A coefficients
- B = table of B coefficients
- Psurf = surface pressure in Pa.
A and B must not contain the first coefficient (A=B=0.)
Returns a table of pressure.
-
epygram.profiles.hybridP2masspressure(A, B, Psurf, vertical_mean)
Computes the pressure at mass levels defined by hybrid-pressure
coefficients. Coefficients are assumed to define flux levels.
- A = table of A coefficients
- B = table of B coefficients
- Psurf = surface pressure in Pa.
- vertical_mean = kind of vertical averaging
A and B must not contain the first coefficient (A=B=0.)
Returns a table of pressure.
-
epygram.profiles.hybridH2fluxheight(A, B, Zsurf, conv2height=False)
Computes the altitude at flux levels defined by hybrid-height coefficients.
Coefficients are assumed to define flux levels.
- A = table of A coefficients
- B = table of B coefficients
- Zsurf = surface altitude in m.
- conv2height True to compute height instead of altitude
A and B must include the underground level
Returns a table of altitudes.
-
epygram.profiles.hybridH2massheight(A, B, Zsurf, conv2height=False)
Computes the altitude at mass levels defined by hybrid-height
coefficients. Coefficients are assumed to define flux levels.
- A = table of A coefficients
- B = table of B coefficients
- Zsurf = surface altitude in m.
- conv2height True to compute height instead of altitude
A and B must include the underground level
Returns a table of altitudes.
-
epygram.profiles.flux2masspressures(pi_tilde, vertical_mean, Ptop=0.0)[source]
Converts pressures at flux levels to mass levels.
-
epygram.profiles.mass2fluxpressures(pi, vertical_mean, Ptop=0.0)[source]
Converts pressures at mass levels to flux levels.
-
epygram.profiles.flux2massheights(H_tilde)
Converts altitudes at flux levels to mass levels.
-
epygram.profiles.mass2fluxheights(H)
Converts altitudes at mass levels to flux levels.
-
epygram.profiles.pressure2altitude(R, T, vertical_mean, pi=None, pi_tilde=None, Pdep=None, Phi_surf=None)[source]
Converts a pressure profile to mass-levels altitude (= height above ground
if Phi_surf == 0).
The pressure can be given at mass levels (pi) or flux levels (pi_tilde),
or both (assuming they are consistent), with unit: Pa.
- R = table of R = specific gas constant (J/kg/K)
- T = table of Temperature (K)
- vertical_mean = kind of vertical averaging
- Pdep = table of Pressure departure: P-Pi, where P is the hydrostatic
pressure and Pi the Non-Hydrostatic pressure (Pa).
- if Hydrostatic (default)
- Phi_surf = surface geopotential (J/kg)
-
epygram.profiles.hybridP2altitude(A, B, R, T, Psurf, vertical_mean, Pdep=None, Phi_surf=None, Ptop=0.0)
Computes the altitude of mass levels defined by hybrid-pressure
coefficients. (= height above ground if Phi_surf == 0).
- A = table of A coefficients
- B = table of B coefficients
- Psurf = surface pressure in Pa.
- R = table of R = specific gas constant (J/kg/K)
- T = table of Temperature (K)
- vertical_mean = kind of vertical averaging
- Pdep = table of Pressure departure: P-Pi, where P is the hydrostatic
pressure and Pi the Non-Hydrostatic pressure (Pa).
- if Hydrostatic (default)
- Phi_surf = surface geopotential (J/kg)
A and B must not contain the first coefficient (A=B=0.)