Derives time series of the cumulative water deficit (CWD), given time series of the daily soil water balance (infiltration minus evapotranspiration). CWD "events" are identified as periods of consecutive days where the CWD is positive (a water deficit). CWD is set to zero after rain has reduced the CWD by a user-defined fraction, relative to maximum CWD attained during the same event.
cwd(
df,
varname_wbal,
varname_date,
thresh_drop = 0,
doy_reset = NA,
do_surplus = FALSE
)a data frame that contains the variable named according to argument varname_wbal
name of the variable representing the daily soil water balance (infiltration minus evapotranspiration)
name of the variable representing information about the date (format irrelevant)
Level, relative to the CWD maximum of the same event, after which all data during the remainder of the event is set to missing values. This is to avoid interpreting data after rain events but before full compensation of CWD. Defaults to 0.9.
Day-of-year (integer) when deficit is to be reset to zero each year. Defaults to
NA (not considered). If doy_reset is set to a non-NA value, it overrides event termination
criteria given by thresh_terminate or thresh_terminate_absolute.
A logical specifying whether the cumulative surplus should be calculated.
Defaults to FALSE.
A list of two data frames (tibbles). inst contains information about CWD "events".
Each row corresponds to one event. An event is defined as a period of consecutive days where the
CWD is positive (a water deficit) and has the following columns:
idx_start: row number of df of which the date corresponds to the start of the event
len: length of the event, quantified as number of rows in df corresponding to the event
iinst: event number
date_start: starting date of the event, formatted as varname_date in df.
date_end: end date of the event, formatted as varname_date in df.
deficit: maximum CWD recorded during this event. Units correspond to units of varname_wbal
in df.