
Detect coldwaves using multiple standard methodologies
Source:R/sus_climate_compute_coldwaves.R
sus_climate_compute_coldwaves.RdApplies seven coldwave detection methods (WHO, WMO, INMET, ECF, UTCI, WBGT,
HI) to a climasus_df at stage "climate" produced by
sus_climate_inmet(), sus_climate_fill_gap(), or
sus_climate_compute_indicators(). Aggregates hourly data to daily scale,
computes smoothed historical percentile thresholds from a reference baseline,
identifies coldwave days and discrete events per method, and returns a named
list with events, daily-flag, and annual-summary tables — all carrying
sus_meta at stage "climate" / type "coldwaves".
Usage
sus_climate_compute_coldwaves(
df,
method = c("WHO", "WMO", "INMET", "EHF", "UTCI", "WBGT", "HI"),
baseline_start = NULL,
baseline_end = NULL,
percentile = 10,
min_duration = NULL,
lang = "pt",
verbose = TRUE
)Arguments
- df
A
climasus_dfat stage"climate"with type"inmet","filled", or"indicators". Produced bysus_climate_inmet(),sus_climate_fill_gap(), orsus_climate_compute_indicators(). Must contain columnsdateandstation_code. Temperature columnstair_max_c,tair_min_c,tair_dry_bulb_care required for WHO/WMO/ INMET/ECF;utci_c,wbgt_c,hi_care required for UTCI/WBGT/HI (available aftersus_climate_compute_indicators()).- method
Character vector. One or more of
"WHO","WMO","INMET","EHF","UTCI","WBGT","HI". Use"all"to run every method. Methods whose required columns are absent emit a warning and are skipped. Note: the internal algorithm for the"EHF"slot uses the Excess Cold Factor (ECF) formula.- baseline_start
Date or character (e.g.,
"1981-01-01"). Start of the reference period for percentile thresholds.NULLuses the full series.- baseline_end
Date or character. End of the reference period.
NULLuses the full series.- percentile
Numeric (0-100, default
10). Percentile used for WHO, WMO, UTCI, WBGT, and HI threshold calculations (lower tail for coldwaves).- min_duration
Integer or
NULL. Minimum consecutive days to qualify as a coldwave.NULLuses method defaults: WHO=3, WMO=5, INMET=5, EHF=3, UTCI=3, WBGT=3, HI=3.- lang
Character. Output language:
"pt"(default),"en","es".- verbose
Logical. Print progress messages. Default
TRUE.
Value
A named list with class climasus_cw and sus_meta attribute
(stage "climate", type "coldwaves"):
eventsOne row per detected event:
event_id,station_code,method,start_date,end_date,duration_days,temp_mean,temp_peak(coldest),anomaly_mean,anomaly_cumulative,severity_index,ecf_peak,ecf_mean,intensity_class, and station metadata.dailyDaily aggregated data with logical flag columns
cw_<method>andcw_any.summaryAnnual summary by station and method:
year,n_events,total_days_cw,mean_duration,max_duration,mean_intensity,max_intensity,mean_anomaly,severity_total.
Implemented methods
1. WHO Tmin < P10(Tmin) for >= N consecutive days (default N=3).
Threshold smoothed over a 15-day rolling window by calendar day-of-year.
Reference: WMO & WHO (2015).
2. WMO Tmin < P10(Tmin) AND Tmax < P10(Tmax) for >= N days (default
N=5). Double threshold ensures both daytime and nighttime extremes are
captured. Reference: Perkins & Alexander (2013).
3. INMET Tmin < mean(Tmin_hist) - 5 degC for >= N days (default N=5).
Climatological mean from the baseline period. Designed for Brazilian context.
4. ECF Excess Cold Factor: ECF = ECI_sig x max(1, ECI_acc) where
ECI_sig = P5(Tmean) - T3 and ECI_acc = T30 - T3. Intensity classified
by ECF85 (85th percentile of positive ECF values). Adaptation of Nairn &
Fawcett (2015) for cold extremes. Positive ECI_acc means the preceding
month was warmer than the recent 3-day mean (body acclimatised to heat,
amplifying cold stress).
5. UTCI UTCImin < P10(UTCImin) for >= N days (default N=3). Requires
utci_c column from sus_climate_compute_indicators().
6. WBGT WBGTmin < P10(WBGTmin) for >= N days (default N=3). Requires
wbgt_c column from sus_climate_compute_indicators().
7. HI HImin < P10(HImin) for >= N days (default N=3). Requires hi_c
column from sus_climate_compute_indicators().
References
Perkins, S.E. & Alexander, L.V. (2013). On the measurement of heat waves. Journal of Climate, 26(13), 4500-4517. (Adapted for coldwaves)
WMO & WHO (2015). Heatwaves and Health: Guidance on Warning-System Development. Geneva. (Adapted for coldwaves)
Nairn, J.R. & Fawcett, R.J.B. (2015). The Excess Heat Factor. Int. J. Environ. Res. Public Health, 12(1), 227-253. (Adapted for cold) doi:10.3390/ijerph120100227
INMET (2009). Normais Climatologicas do Brasil 1961-1990. Brasilia.
Examples
if (FALSE) { # \dontrun{
cw <- df_indicators |>
sus_climate_compute_coldwaves(
method = c("WHO", "INMET", "EHF"),
baseline_start = "2000-01-01",
baseline_end = "2020-12-31",
lang = "pt"
)
cw$events
cw$summary
cw$daily[cw$daily$cw_any, ]
} # }