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:
data (xr.Dataset) – The soundings, as
lair.soundings.get_soundings()returns them.integration_height (int) – The height to integrate to [m].
- Returns:
pd.Series – The valley heat deficit [MJ/m^2] named
VHD_MJ_m2, indexed byTime_UTC.- Return type:
See also
determine_pcap_eventsFinds the events where it stays high.
lair.soundings.get_soundingsReads the soundings it takes.
lair.meteorology.poissonThe potential temperature it integrates.
Notes
dataneeds temperature in degrees Celsius, pressure in hPa, aheightdimension, and theelevationandinterpolation_intervalattributes thatget_soundingssets.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