pycontrails.physics.thermo¶
Thermodynamic relationships.
Functions
|
Calculate potential temperature. |
|
Calculate the potential temperature gradient between two altitudes. |
|
Calculate the Brunt-Vaisaila frequency. |
|
Calculate isobaric heat capacity of moist air. |
|
Calculate saturation pressure of water vapor over ice. |
|
Calculate saturation pressure of water vapor over liquid water. |
|
Calculate the vapor pressure. |
|
Calculate the pressure altitude |
|
Calculate saturation specific humidity over liquid or ice. |
|
Calculate saturation specific humidity over ice. |
|
Calculate saturation specific humidity over liquid. |
|
Calculate the relative humidity with respect to to liquid water. |
|
Calculate the relative humidity with respect to ice (RHi). |
|
Calculate air density for (T, p) assuming dry air. |
|
Calculate the air density for (T, p) assuming all water vapor. |
- pycontrails.physics.thermo.T_potential(T, p)¶
Calculate potential temperature.
The potential temperature is the temperature that an air parcel would attain if adiabatically brought to a standard reference pressure,
constants.p_surface
.- Parameters:
T (
ArrayScalarLike
) – Temperature , [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Potential Temperature, [\(K\)]
References
- pycontrails.physics.thermo.T_potential_gradient(T_top, p_top, T_btm, p_btm, dz)¶
Calculate the potential temperature gradient between two altitudes.
- Parameters:
T_top (
ArrayScalarLike
) – Temperature at original altitude, [\(K\)]p_top (
ArrayScalarLike
) – Pressure at original altitude, [\(Pa\)]T_btm (
ArrayScalarLike
) – Temperature at lower altitude, [\(K\)]p_btm (
ArrayScalarLike
) – Pressure at lower altitude, [\(Pa\)]dz (
float
) – Difference in altitude between measurements, [\(m\)]
- Returns:
ArrayScalarLike
– Potential Temperature gradient, [\(K \ m^{-1}\)]
- pycontrails.physics.thermo.brunt_vaisala_frequency(p, T, T_grad)¶
Calculate the Brunt-Vaisaila frequency.
The Brunt-Vaisaila frequency is the frequency at which a vertically displaced parcel will oscillate within a statically stable environment.
- Parameters:
p (
numpy.ndarray
) – Pressure, [\(Pa\)]T (
numpy.ndarray
) – Temperature , [\(K\)]T_grad (
numpy.ndarray
) – Potential Temperature gradient (seeT_potential_gradient()
), [\(K \ m^{-1}\)]
- Returns:
numpy.ndarray
– Brunt-Vaisaila frequency, [\(s^{-1}\)]
References
- pycontrails.physics.thermo.c_pm(q)¶
Calculate isobaric heat capacity of moist air.
- Parameters:
q (
ArrayScalarLike
) – Specific humidity, [\(kg \ kg^{-1}\)]- Returns:
ArrayScalarLike
– Isobaric heat capacity of moist air, [\(J \ kg^{-1} \ K^{-1}\)]
Notes
Some models (including CoCiP) use a constant value here (1004 \(J \ kg^{-1} \ K^{-1}\))
- pycontrails.physics.thermo.e_sat_ice(T)¶
Calculate saturation pressure of water vapor over ice.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]- Returns:
ArrayScalarLike
– Saturation pressure of water vapor over ice, [\(Pa\)]
References
- pycontrails.physics.thermo.e_sat_liquid(T)¶
Calculate saturation pressure of water vapor over liquid water.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]- Returns:
ArrayScalarLike
– Saturation pressure of water vapor over liquid water, [\(Pa\)]
References
- pycontrails.physics.thermo.p_vapor(q, p)¶
Calculate the vapor pressure.
- Parameters:
q (
ArrayScalarTypeVar
) – Specific humidity, [\(kg \ kg^{-1}\)]p (
ArrayScalarTypeVar
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarTypeVar
– Vapor pressure, [\(Pa\)]
- pycontrails.physics.thermo.pressure_dz(T, p, dz)¶
Calculate the pressure altitude
dz
meters below input pressure.Returns surface pressure if the calculated pressure altitude is greater than
constants.p_surface
.- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]dz (
float
) – Difference in altitude between measurements, [\(m\)]
- Returns:
ArrayScalarLike
– Pressure at altitude, [\(Pa\)]
Notes
This is used to calculate the temperature gradient and wind shear.
- pycontrails.physics.thermo.q_sat(T, p)¶
Calculate saturation specific humidity over liquid or ice.
When T is above 0 C, liquid saturation is computed. Otherwise, ice saturation is computed.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Saturation specific humidity, [\(kg \ kg^{-1}\)]
Notes
Smith et al. (1999)
- pycontrails.physics.thermo.q_sat_ice(T, p)¶
Calculate saturation specific humidity over ice.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Saturation specific humidity, [\(kg \ kg^{-1}\)]
Notes
Smith et al. (1999)
- pycontrails.physics.thermo.q_sat_liquid(T, p)¶
Calculate saturation specific humidity over liquid.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Saturation specific humidity, [\(kg \ kg^{-1}\)]
Notes
Smith et al. (1999)
- pycontrails.physics.thermo.rh(q, T, p)¶
Calculate the relative humidity with respect to to liquid water.
- Parameters:
q (
ArrayScalarLike
) – Specific humidity, [\(kg \ kg^{-1}\)]T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Relative Humidity, \([0 - 1]\)
- pycontrails.physics.thermo.rhi(q, T, p)¶
Calculate the relative humidity with respect to ice (RHi).
- Parameters:
q (
ArrayScalarLike
) – Specific humidity, [\(kg \ kg^{-1}\)]T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Relative Humidity over ice, \([0 - 1]\)
- pycontrails.physics.thermo.rho_d(T, p)¶
Calculate air density for (T, p) assuming dry air.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Air density of dry air, [\(kg \ m^{-3}\)]
- pycontrails.physics.thermo.rho_v(T, p)¶
Calculate the air density for (T, p) assuming all water vapor.
- Parameters:
T (
ArrayScalarLike
) – Temperature, [\(K\)]p (
ArrayScalarLike
) – Pressure, [\(Pa\)]
- Returns:
ArrayScalarLike
– Air density of water vapor, [\(kg \ m^{-3}\)]