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)[source]

Computes and returns the pressure at flux levels defined by hybrid-pressure coefficients. Coefficients are assumed to define flux levels.

Parameters
  • 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.)

epygram.profiles.hybridP2masspressure(A, B, Psurf, vertical_mean)[source]

Computes and returns the pressure at mass levels defined by hybrid-pressure coefficients. Coefficients are assumed to define flux levels.

Parameters
  • 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.)

epygram.profiles.hybridH2fluxheight(A, B, Zsurf, conv2height=False)[source]

Computes and returns the altitude at flux levels defined by hybrid-height coefficients. Coefficients are assumed to define flux levels.

Parameters
  • 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

epygram.profiles.hybridH2massheight(A, B, Zsurf, conv2height=False)[source]

Computes and returns the altitude at mass levels defined by hybrid-height coefficients. Coefficients are assumed to define flux levels.

Parameters
  • 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

epygram.profiles.flux2masspressures(pi_tilde, vertical_mean, Ptop=0.0, LAPRXPK=True, LAPRXPK_for_first_level=True)[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)[source]

Converts altitudes at flux levels to mass levels.

epygram.profiles.mass2fluxheights(H)[source]

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.

Parameters
  • pi – mass levels pressure

  • pi_tilde – flux levels pressure

  • 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). 0. 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)[source]

Computes the altitude of mass levels defined by hybrid-pressure coefficients. (= height above ground if Phi_surf == 0).

Parameters
  • 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). 0. if Hydrostatic (default)

  • Phi_surf – surface geopotential (J/kg)

A and B must not contain the first coefficient (A=B=0.)