Constants

metpy.constants

This is a collection of meteorologically significant constants.

Earth

Name Abbr. Units Description
earth_avg_radius Re m Avg. radius of the Earth
earth_gravity g m s^-2 Avg. gravity acceleration on Earth
earth_avg_angular_vel omega rad s^-1 Avg. angular velocity of Earth
earth_sfc_avg_dist_sun d m Avg. distance of the Earth from the Sun
earth_solar_irradiance S W m^-2 Avg. solar irradiance of Earth
earth_max_declination delta degrees Max. solar declination angle of Earth
earth_orbit_eccentricity   None Avg. eccentricity of Earth’s orbit

Water

Name Abbr. Units Description
water_molecular_weight Mw g mol^-1 Molecular weight of water
water_gas_constant Rv J (K kg)^-1 Gas constant for water vapor
density_water rho_l kg m^-3 Nominal density of liquid water at 0C
wv_specific_heat_press Cp_v J (K kg)^-1 Specific heat at constant pressure for water vapor
wv_specific_heat_vol Cv_v J (K kg)^-1 Specific heat at constant volume for water vapor
water_specific_heat Cp_l J (K kg)^-1 Specific heat of liquid water at 0C
water_heat_vaporization Lv J kg^-1 Latent heat of vaporization for liquid water at 0C
water_heat_fusion Lf J kg^-1 Latent heat of fusion for liquid water at 0C
ice_specific_heat Cp_i J (K kg)^-1 Specific heat of ice at 0C
density_ice rho_i kg m^-3 Density of ice at 0C

Dry Air

Name Abbr. Units Description
dry_air_molecular_weight Md g / mol Nominal molecular weight of dry air at the surface of th Earth
dry_air_gas_constant Rd J (K kg)^-1 Gas constant for dry air at the surface of the Earth
dry_air_spec_heat_press Cp_d J (K kg)^-1 Specific heat at constant pressure for dry air
dry_air_spec_heat_vol Cv_d J (K kg)^-1 Specific heat at constant volume for dry air
dry_air_density_stp rho_d kg m^-3 Density of dry air at 0C and 1000mb

General Meteorology Constants

Name Abbr. Units Description
pot_temp_ref_press P0 Pa Reference pressure for potential temperature
poisson_exponent kappa None Exponent in Poisson’s equation (Rd/Cp_d)
dry_adiabatic_lapse_rate gamma_d K km^-1 The dry adiabatic lapse rate
molecular_weight_ratio epsilon None Ratio of molecular weight of water to that of dry air

Temperature Conversion Functions

F2C(*args, **kwds) F2C is deprecated!
F2K(*args, **kwds) F2K is deprecated!
C2F(*args, **kwds) C2F is deprecated!
K2F(*args, **kwds) K2F is deprecated!
C2K(*args, **kwds) C2K is deprecated!
K2C(*args, **kwds) K2C is deprecated!
metpy.constants.C2K(*args, **kwds)

C2K is deprecated! scipy.constants.C2K is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Celsius to Kelvin

C : array_like
Celsius temperature(s) to be converted.
K : float or array of floats
Equivalent Kelvin temperature(s).

convert_temperature

Computes K = C + zero_Celsius where zero_Celsius = 273.15, i.e., (the absolute value of) temperature “absolute zero” as measured in Celsius.

>>> from scipy.constants import C2K
>>> C2K(np.array([-40, 40.0]))
array([ 233.15,  313.15])
metpy.constants.F2K(*args, **kwds)

F2K is deprecated! scipy.constants.F2K is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Fahrenheit to Kelvin

F : array_like
Fahrenheit temperature(s) to be converted.
K : float or array of floats
Equivalent Kelvin temperature(s).

convert_temperature

Computes K = (F - 32)/1.8 + zero_Celsius where zero_Celsius = 273.15, i.e., (the absolute value of) temperature “absolute zero” as measured in Celsius.

>>> from scipy.constants import F2K
>>> F2K(np.array([-40, 104]))
array([ 233.15,  313.15])
metpy.constants.C2F(*args, **kwds)

C2F is deprecated! scipy.constants.C2F is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Celsius to Fahrenheit

C : array_like
Celsius temperature(s) to be converted.
F : float or array of floats
Equivalent Fahrenheit temperature(s).

convert_temperature

Computes F = 1.8 * C + 32.

>>> from scipy.constants import C2F
>>> C2F(np.array([-40, 40.0]))
array([ -40.,  104.])
metpy.constants.F2C(*args, **kwds)

F2C is deprecated! scipy.constants.F2C is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Fahrenheit to Celsius

F : array_like
Fahrenheit temperature(s) to be converted.
C : float or array of floats
Equivalent Celsius temperature(s).

convert_temperature

Computes C = (F - 32) / 1.8.

>>> from scipy.constants import F2C
>>> F2C(np.array([-40, 40.0]))
array([-40.        ,   4.44444444])
metpy.constants.K2C(*args, **kwds)

K2C is deprecated! scipy.constants.K2C is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Kelvin to Celsius

K : array_like
Kelvin temperature(s) to be converted.
C : float or array of floats
Equivalent Celsius temperature(s).

convert_temperature

Computes C = K - zero_Celsius where zero_Celsius = 273.15, i.e., (the absolute value of) temperature “absolute zero” as measured in Celsius.

>>> from scipy.constants import K2C
>>> K2C(np.array([233.15, 313.15]))
array([-40.,  40.])
metpy.constants.K2F(*args, **kwds)

K2F is deprecated! scipy.constants.K2F is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.

Convert Kelvin to Fahrenheit

K : array_like
Kelvin temperature(s) to be converted.
F : float or array of floats
Equivalent Fahrenheit temperature(s).

convert_temperature

Computes F = 1.8 * (K - zero_Celsius) + 32 where zero_Celsius = 273.15, i.e., (the absolute value of) temperature “absolute zero” as measured in Celsius.

>>> from scipy.constants import K2F
>>> K2F(np.array([233.15,  313.15]))
array([ -40.,  104.])