heatwave_days: Heatwave days

View source: R/exposure_daily.R

heatwave_daysR Documentation

Heatwave days

Description

Flags the days of a daily maximum temperature series that fall in a heatwave, under one of three definitions:

  • "imd": India Meteorological Department. A day qualifies when Tmax is at least 40 C (plains), 37 C (coastal) or 30 C (hilly) and departs at least 4.5 C from the calendar-day normal, or when Tmax is at least 45 C. Severe: departure above 6.4 C with Tmax at least 40 C (plains, coastal) or 30 C (hilly), or Tmax of at least 47 C. A heatwave needs min_duration (2) consecutive qualifying days. IMD also requires 2 stations in a meteorological sub-division; each series here is judged on its own.

  • "percentile": Tmax above the calendar-day percentile of the baseline years (5-day window) for at least min_duration (3) days, as in Rohini et al. (2016) for India.

  • "ehf": days covered by a three-day period with positive excess_heat_factor(); severe when EHF reaches EHF85.

Usage

heatwave_days(
  date,
  tmax,
  tmin = NULL,
  method = c("imd", "percentile", "ehf"),
  baseline = c(1991, 2020),
  terrain = c("plains", "coastal", "hilly"),
  percentile = 0.9,
  min_duration = NULL,
  window = 2L
)

Arguments

date

Dates of a strictly increasing daily series for one location.

tmax

Daily maximum temperature (degrees Celsius).

tmin

Daily minimum temperature; required for method = "ehf".

method

"imd", "percentile" or "ehf".

baseline

Climatology years, c(first, last), contained in date.

terrain

For "imd": "plains", "coastal" or "hilly"; see imd_terrain() to classify a location.

percentile

Threshold quantile for "percentile".

min_duration

Minimum run of qualifying days; defaults to 2 for "imd" and 3 for "percentile" and "ehf".

window

Half-width in days of the calendar-day window.

Details

The calendar-day normal is the baseline mean over a 2 * window + 1 day window. Percentiles use stats::quantile() type 8 without the in-base bootstrap of the ETCCDI indices.

Value

A data.frame with date, day (in a heatwave), severe, spell_start and spell_length (on the first day of each heatwave).

References

India Meteorological Department. Heat wave and warm night definitions. https://mausam.imd.gov.in/pdfs/heatcolduser/Definition.pdf

Rohini, P., Rajeevan, M. & Srivastava, A.K. (2016). On the Variability and Increasing Trends of Heat Waves over India. Scientific Reports, 6, 26153. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/srep26153")}

Examples

d <- seq(as.Date("2001-01-01"), as.Date("2003-12-31"), by = "day")
doy <- as.POSIXlt(d)$yday
tmax <- 33 + 8 * sin(2 * pi * (doy - 80) / 365)
tmax[d >= as.Date("2003-05-10") & d <= as.Date("2003-05-13")] <- 46
hw <- heatwave_days(d, tmax, baseline = c(2001, 2002))
subset(hw, day)

varunayan documentation built on Oct. 30, 2026, 1:07 a.m.