lair.pcaps.valleyheatdeficit#

lair.pcaps.valleyheatdeficit(data, integration_height=2200)[source]#

Calculate the valley heat deficit.

Whiteman, C. David, et al. “Relationship between Particulate Air Pollution and Meteorological Variables in Utah’s Salt Lake Valley.” Atmospheric Environment, vol. 94, Sept. 2014, pp. 742-53. DOI.org (Crossref), https://doi.org/10.1016/j.atmosenv.2014.06.012.

Parameters:
Returns:

pd.Series – The valley heat deficit [MJ/m^2] named VHD_MJ_m2, indexed by Time_UTC.

Return type:

Series

See also

determine_pcap_events

Finds the events where it stays high.

lair.soundings.get_soundings

Reads the soundings it takes.

lair.meteorology.poisson

The potential temperature it integrates.

Notes

data needs temperature in degrees Celsius, pressure in hPa, a height dimension, and the elevation and interpolation_interval attributes that get_soundings sets.

Examples

Two made-up soundings, a cold pool (temperature falling 2 K per kilometer) and a well-mixed one (6.5 K per kilometer), 12 hours apart:

>>> import numpy as np
>>> import pandas as pd
>>> import xarray as xr
>>> from lair.pcaps import valleyheatdeficit
>>> height = np.arange(1289.0, 3300.0, 10.0)
>>> temperature = np.vstack(
...     [-5 - 2.0 * (height - 1289) / 1000, 0 - 6.5 * (height - 1289) / 1000]
... )
>>> pressure = np.tile(870 * np.exp(-(height - 1289) / 8000), (2, 1))
>>> soundings = xr.Dataset(
...     {
...         "temperature": (("time", "height"), temperature),
...         "pressure": (("time", "height"), pressure),
...     },
...     coords={
...         "time": pd.to_datetime(["2024-01-15 00:00", "2024-01-15 12:00"]),
...         "height": height,
...     },
...     attrs={"elevation": 1289.0, "interpolation_interval": 10},
... )
>>> valleyheatdeficit(soundings).round(1)
Time_UTC
2024-01-15 00:00:00    3.6
2024-01-15 12:00:00    1.5
Name: VHD_MJ_m2, dtype: float64