varunayan.heat_stress module¶
Heat stress index calculations.
- varunayan.heat_stress.relative_humidity_from_dewpoint(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate relative humidity from temperature and dewpoint using Magnus-Tetens formula.
- Parameters:
temp_c – Air temperature in Celsius
dewpoint_c – Dewpoint temperature in Celsius
- Returns:
Relative humidity as percentage (0-100)
- varunayan.heat_stress.vapor_pressure_from_dewpoint(dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate vapor pressure from dewpoint using Magnus formula.
- Parameters:
dewpoint_c – Dewpoint temperature in Celsius
- Returns:
Vapor pressure in hPa
Reference: Bolton (1980), Mon. Wea. Rev. 108, 1046-1053.
- varunayan.heat_stress.wet_bulb_temperature(temp_c: float | ndarray | Series, rh: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate wet bulb temperature using Stull (2011) empirical formula.
Reference: Stull, R. (2011). Wet-Bulb Temperature from Relative Humidity and Air Temperature. J. Appl. Meteor. Climatol., 50, 2267-2269.
- Parameters:
temp_c – Air temperature in Celsius
rh – Relative humidity as percentage (0-100)
- Returns:
Wet bulb temperature in Celsius
- varunayan.heat_stress.wet_bulb_from_dewpoint(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate wet bulb temperature from temperature and dewpoint.
- varunayan.heat_stress.heat_index(temp_c: float | ndarray | Series, rh: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate Heat Index using the Rothfusz NWS equation.
- Parameters:
temp_c – Air temperature in Celsius
rh – Relative humidity as percentage (0-100)
- Returns:
Heat index in Celsius
- varunayan.heat_stress.heat_index_from_dewpoint(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate heat index from temperature and dewpoint.
- varunayan.heat_stress.wbgt_simple(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Estimate Wet Bulb Globe Temperature using the Australian BoM approximation.
Closed-form WBGT from air temperature and humidity alone. Standard estimator in climate-epidemiology when wind/radiation are unavailable.
Reference: Australian Bureau of Meteorology approximation of WBGT (Steadman-based); see ACSM heat guidelines.
- Parameters:
temp_c – Air temperature in Celsius
dewpoint_c – Dewpoint temperature in Celsius
- Returns:
WBGT in Celsius
- varunayan.heat_stress.wbgt_shade(temp_c: float | ndarray | Series, wet_bulb_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate shade/indoor Wet Bulb Globe Temperature (ISO 7243).
Uses the indoor formula 0.7*Tw + 0.3*Ta. For a closed-form estimate from temperature and humidity alone, use wbgt_simple(); for outdoor WBGT with an explicit globe temperature, use wbgt_outdoor().
Reference: ISO 7243 standard for occupational heat stress.
- Parameters:
temp_c – Air temperature in Celsius
wet_bulb_c – Wet bulb temperature in Celsius
- Returns:
WBGT in Celsius
- varunayan.heat_stress.wbgt_outdoor(temp_c: float | ndarray | Series, wet_bulb_c: float | ndarray | Series, globe_temp_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate outdoor Wet Bulb Globe Temperature with solar load.
Reference: ISO 7243 standard for occupational heat stress.
- Parameters:
temp_c – Air temperature in Celsius
wet_bulb_c – Wet bulb temperature in Celsius
globe_temp_c – Black globe temperature in Celsius
- Returns:
WBGT in Celsius
- varunayan.heat_stress.humidex(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series) float | ndarray | Series[source]¶
Calculate Humidex (Canadian heat discomfort index).
- Parameters:
temp_c – Air temperature in Celsius
dewpoint_c – Dewpoint temperature in Celsius
Reference: Masterson & Richardson (1979), Environment Canada.
- Returns:
Humidex value (unitless, but interpreted like temperature)
- varunayan.heat_stress.mean_radiant_temperature(temp_c: float | ndarray | Series, solar_rad_wm2: float | ndarray | Series, wind_ms: float | ndarray | Series | None = None) float | ndarray | Series[source]¶
Estimate mean radiant temperature from global horizontal solar radiation.
Closed-form radiation-balance estimator for a standard person from Thorsson et al. (2007), absorbing global horizontal shortwave onto the longwave radiant balance.
Reference: Thorsson, S., et al. (2007). Different methods for estimating the mean radiant temperature in an outdoor urban setting. Int. J. Climatol., 27(14), 1983-1993.
- Parameters:
temp_c – Air temperature in Celsius
solar_rad_wm2 – Global horizontal solar radiation in W/m²
wind_ms – Unused; kept for backward-compatible signature. Wind enters the convective terms of UTCI/WBGT, not this radiant estimate.
- Returns:
Estimated mean radiant temperature in Celsius
- varunayan.heat_stress.utci(temp_c: float | ndarray | Series, rh: float | ndarray | Series, wind_ms: float | ndarray | Series, mrt_c: float | ndarray | Series | None = None) float | ndarray | Series[source]¶
Calculate Universal Thermal Climate Index (UTCI) using polynomial approximation.
Reference: Bröde et al. (2012). Deriving the operational procedure for the Universal Thermal Climate Index (UTCI).
- Parameters:
temp_c – Air temperature in Celsius (-50 to 50°C)
rh – Relative humidity as percentage (0-100)
wind_ms – Wind speed at 10m height in m/s (0.5 to 17 m/s)
mrt_c – Mean radiant temperature in Celsius. If None, assumes mrt = temp_c
- Returns:
UTCI in Celsius
- varunayan.heat_stress.utci_sparse(temp_c: float | ndarray | Series, tmrt: float | ndarray | Series, wind_speed: float | ndarray | Series, rh: float | ndarray | Series) float | ndarray | Series[source]¶
UTCI via sparse Legendre polynomial (Roman et al. 2025, doi:10.5281/zenodo.17465548).
Wider wind range than Bröde polynomial (0.5-30.3 m/s vs 0.5-17 m/s).
- varunayan.heat_stress.heat_index_risk_category(hi: float | ndarray | Series) str | ndarray | Series[source]¶
Categorize heat index into NWS risk categories.
Categories: - Normal: < 27°C - Caution: 27-32°C - Extreme Caution: 32-39°C - Danger: 39-51°C - Extreme Danger: >= 51°C
- Parameters:
hi – Heat index in Celsius
- Returns:
Risk category string(s)
- varunayan.heat_stress.wbgt_risk_category(wbgt: float | ndarray | Series) str | ndarray | Series[source]¶
Categorize WBGT into ISO 7243 risk categories for occupational heat stress.
Categories: - Low: < 25°C - Moderate: 25-28°C - High: 28-30°C - Very High: 30-32°C - Extreme: >= 32°C
- Parameters:
wbgt – WBGT in Celsius
- Returns:
Risk category string(s)
- varunayan.heat_stress.utci_category(utci_val: float | ndarray | Series) str | ndarray | Series[source]¶
Categorize UTCI into thermal stress categories.
Categories (10-level scale): - Extreme Cold Stress: < -40°C - Very Strong Cold Stress: -40 to -27°C - Strong Cold Stress: -27 to -13°C - Moderate Cold Stress: -13 to 0°C - Slight Cold Stress: 0 to 9°C - No Thermal Stress: 9 to 26°C - Moderate Heat Stress: 26 to 32°C - Strong Heat Stress: 32 to 38°C - Very Strong Heat Stress: 38 to 46°C - Extreme Heat Stress: >= 46°C
- Parameters:
utci_val – UTCI in Celsius
- Returns:
Thermal stress category string(s)
- varunayan.heat_stress.calc_heat_indices(temp_c: float | ndarray | Series, dewpoint_c: float | ndarray | Series, wind_ms: float | ndarray | Series | None = None, solar_rad_wm2: float | ndarray | Series | None = None) Dict[str, float | str | ndarray | Series][source]¶
Calculate all heat stress indices at once.
- Parameters:
temp_c – Air temperature in Celsius
dewpoint_c – Dewpoint temperature in Celsius
wind_ms – Wind speed in m/s (optional, needed for UTCI)
solar_rad_wm2 – Solar radiation in W/m² (optional, for outdoor MRT)
- Returns:
rh: Relative humidity (%)
wet_bulb: Wet bulb temperature (°C)
heat_index: Heat index (°C)
wbgt: Wet Bulb Globe Temperature (°C)
humidex: Humidex value
utci: Universal Thermal Climate Index (°C) - if wind provided
heat_index_risk: Risk category for heat index
wbgt_risk: Risk category for WBGT
utci_stress: Stress category for UTCI - if wind provided
- Return type:
Dictionary with all calculated indices