warm_nights: Warm nights

View source: R/exposure_daily.R

warm_nightsR Documentation

Warm nights

Description

Flags warm nights in a daily minimum temperature series:

  • "imd": India Meteorological Department. Tmax of at least 40 C and Tmin departing at least 4.5 C from the calendar-day normal; very warm (flagged severe) above 6.4 C.

  • "percentile": Tmin above the calendar-day percentile of the baseline years (ETCCDI TN90p with the default 0.9).

  • "absolute": Tmin above threshold (ETCCDI tropical nights, TR, with the default 20 C).

Usage

warm_nights(
  date,
  tmin,
  tmax = NULL,
  method = c("imd", "percentile", "absolute"),
  baseline = c(1991, 2020),
  percentile = 0.9,
  threshold = 20,
  min_duration = 1L,
  window = 2L
)

Arguments

date

Dates of a strictly increasing daily series for one location.

tmin

Daily minimum temperature (degrees Celsius).

tmax

Daily maximum temperature; required for method = "imd".

method

"imd", "percentile" or "absolute".

baseline

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

percentile

Threshold quantile for "percentile".

threshold

Tmin threshold for "absolute" (degrees Celsius).

min_duration

Minimum run of warm nights counted as a spell.

window

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

Value

A data.frame with date, day (a warm night within a spell), severe, spell_start and spell_length.

References

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

Zhang, X., Alexander, L., Hegerl, G.C., Jones, P., Klein Tank, A., Peterson, T.C., Trewin, B. & Zwiers, F.W. (2011). Indices for monitoring changes in extremes based on daily temperature and precipitation data. WIREs Climate Change, 2(6), 851-870. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/wcc.147")}

Examples

d <- seq(as.Date("2001-01-01"), as.Date("2001-12-31"), by = "day")
tmin <- 22 + 6 * sin(2 * pi * (as.POSIXlt(d)$yday - 80) / 365)
wn <- warm_nights(d, tmin, method = "absolute", threshold = 27)
sum(wn$day)

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