disdrodb.physics package#

Submodules#

disdrodb.physics.atmosphere module#

DISDRODB atmospheric physics module.

disdrodb.physics.atmosphere.get_air_density(temperature, air_pressure, vapor_pressure, gas_constant_dry_air=287.04)[source][source]#

Computes the air density according to the equation of state for moist air.

Reference: Brutsaert 1982

Parameters:
  • temperature (float) – Temperature in Kelvin.

  • air_pressure (float) – Air pressure in Pascals.

  • vapor_pressure (float) – Vapor pressure in Pascals.

  • gas_constant_dry_air (float, optional) – Gas constant for dry air in J/(kg*K). The default is 287.04 J/(kg*K).

Returns:

Air density in kg/m^3.

Return type:

float

disdrodb.physics.atmosphere.get_air_dynamic_viscosity(temperature)[source][source]#

Computes the dynamic viscosity of dry air.

Reference: Beard 1977; Pruppacher & Klett 1978

Parameters:

temperature (float) – Temperature in Kelvin.

Returns:

Dynamic viscosity of dry air in kg/(m*s) (aka Pa*s).

Return type:

float

disdrodb.physics.atmosphere.get_air_pressure_at_height(altitude, latitude, temperature, sea_level_air_pressure=101325, lapse_rate=0.0065, gas_constant_dry_air=287.04)[source][source]#

Computes the air pressure at a given height in a standard atmosphere.

According to the hypsometric formula of Brutsaert 1982; Ulaby et al. 1981

Parameters:
  • altitude (float) – Altitude in meters.

  • latitude (float) – Latitude in degrees.

  • temperature (float) – Temperature at altitude in Kelvin.

  • sea_level_air_pressure (float, optional) – Standard atmospheric pressure at sea level in Pascals. The default is 101_325 Pascals.

  • lapse_rate (float, optional) – Standard atmospheric lapse rate in K/m. The default is 0.0065 K/m.

  • gas_constant_dry_air (float, optional) – Gas constant for dry air in J/(kg*K). The default is 287.04 J/(kg*K).

Returns:

Air pressure in Pascals.

Return type:

float

disdrodb.physics.atmosphere.get_air_temperature_at_height(altitude, sea_level_temperature, lapse_rate=0.0065)[source][source]#

Computes the air temperature at a given height in a standard atmosphere.

Reference: Brutsaert 1982; Ulaby et al. 1981

Parameters:
  • altitude (float) – Altitude in meters.

  • sea_level_temperature (float) – Standard temperature at sea level in Kelvin.

  • lapse_rate (float, optional) – Standard atmospheric lapse rate in K/m. The default is 0.0065 K/m.

Returns:

Air temperature in Kelvin.

Return type:

float

disdrodb.physics.atmosphere.get_gravitational_acceleration(latitude, altitude=0)[source][source]#

Computes gravitational acceleration at a given altitude and latitude.

Parameters:
  • altitude (float) – Altitude in meters. The default is 0 m (sea level).

  • latitude (float) – Latitude in degrees.

Returns:

Gravitational acceleration in m/s^2.

Return type:

float

disdrodb.physics.atmosphere.get_vapor_actual_pressure(relative_humidity, temperature)[source][source]#

Computes the actual vapor pressure over water.

Parameters:
  • relative_humidity (float) – Relative humidity. A value between 0 and 1.

  • temperature (float) – Temperature in Kelvin.

Returns:

Actual vapor pressure in Pascal.

Return type:

float

disdrodb.physics.atmosphere.get_vapor_actual_pressure_at_height(altitude, sea_level_temperature, sea_level_relative_humidity, sea_level_air_pressure=101325, lapse_rate=0.0065)[source][source]#

Computes the vapor pressure using Yamamoto’s exponential relationship.

Reference: Brutsaert 1982

Parameters:
  • altitude (float) – Altitude in meters.

  • sea_level_temperature (float) – Standard temperature at sea level in Kelvin.

  • sea_level_relative_humidity (float) – Relative humidity at sea level. A value between 0 and 1.

  • sea_level_air_pressure (float, optional) – Standard atmospheric pressure at sea level in Pascals. The default is 101_325 Pascals.

  • lapse_rate (float, optional) – Standard atmospheric lapse rate in K/m. The default is 0.0065 K/m.

Returns:

Vapor pressure in Pascals.

Return type:

float

disdrodb.physics.atmosphere.get_vapor_saturation_pressure(temperature)[source][source]#

Computes the saturation vapor pressure over water as a function of temperature.

Use formulation and coefficients of Wexler (1976, 1977). References: Brutsaert 1982; Pruppacher & Klett 1978; Flatau & al. 1992

Parameters:

temperature (float) – Temperature in Kelvin.

Returns:

Saturation vapor pressure in Pascal.

Return type:

float

disdrodb.physics.water module#

DISDRODB water physics module.

disdrodb.physics.water.get_pure_water_compressibility(temperature)[source][source]#

Computes the isothermal compressibility of pure ordinary water.

Reference: Kell, Weast & Astle 1980

Parameters:

temperature (float) – Temperature in Kelvin.

Returns:

Compressibility of water in Pascals.

Return type:

float

disdrodb.physics.water.get_pure_water_density(temperature)[source][source]#

Computes the density of pure water at standard pressure.

For temperatures above freezing uses Kell formulation. For temperatures below freezing use Dorsch & Boyd formulation.

References: Pruppacher & Klett 1978; Weast & Astle 1980

Parameters:

temperature (float) – Temperature in Kelvin.

Returns:

Density of pure water in kg/m^3.

Return type:

float

disdrodb.physics.water.get_pure_water_surface_tension(temperature)[source][source]#

Computes the surface tension of pure ordinary water against air.

Reference: Pruppacher & Klett 1978

Parameters:

temperature (float) – Temperature in Kelvin.

Returns:

Surface tension in N/m.

Return type:

float

disdrodb.physics.water.get_water_density(temperature, air_pressure, sea_level_air_pressure=101325)[source][source]#

Computes the density of water according to Weast & Astle 1980.

Parameters:
  • temperature (float) – Temperature in Kelvin.

  • air_pressure (float) – Air pressure in Pascals.

  • sea_level_air_pressure (float) – Standard atmospheric pressure at sea level in Pascals. The default is 101_325 Pascal.

  • freezing_temperature (float, optional) – Freezing temperature of water in Kelvin. The default is 273.15 K.

Returns:

Water density in kg/m^3.

Return type:

float

disdrodb.physics.wrappers module#

DISDRODB physics wrapper functions.

disdrodb.physics.wrappers.retrieve_air_density(ds_env)[source][source]#

Retrieve air density.

disdrodb.physics.wrappers.retrieve_air_dynamic_viscosity(ds_env)[source][source]#

Retrieve air dynamic viscosity.

disdrodb.physics.wrappers.retrieve_air_pressure(ds_env)[source][source]#

Retrieve air pressure.

Module contents#

DISDRODB physics module.