Skip to content

Diagnosing variables

Thomas Nipen edited this page Jun 18, 2020 · 15 revisions

Gridpp has convenience functions for converting between related weather variables. As of v0.4.2, functions taking scalar inputs are supported, but this will be expanded to vectorized versions in the future.

Humidity

There are several humidity variables: dewpoint temperature, relative humidity, and wetbulb temperature. These can be diagnosed from each other in combination with temperature (and pressure for wetbulb):

temperature = 278 # K
dewpoint = 275 # K
rh = 0.9 # fraction
pressure = 101325 # pa
value = gridpp.dewpoint(temperature, rh)
value = gridpp.relative_humidity(temperature, dewpoint)
value = gridpp.wetbulb(temperature, pressure, rh)

Wind

Gridpp can convert from x and y components to wind_speed (in the future between direction as well):

x = 10
y = 5
wind_speed = gridpp.wind_speed(x, y)

Aviation

To compute QNH from surface pressure and altitude:

pressure = 90000  # pa
altitude = 1000   # m
qnh = gridpp.qnh(pressure, altitude)

Clone this wiki locally