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_terminate = 0,
thresh_terminate_absolute = NA,
thresh_drop = 0.9,
doy_reset = 999
)
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)
threshold determining the level, relative to maximum CWD attained during the same event, to which a CWD has to be reduced to terminate the event. Defaults to 0, meaning that the CWD has to be fully compensated by water infiltration into the soil to terminate a CWD event.
threshold determining end of event, as thresh_terminate
but in absolute terms
(in the same units as varname_wbal
is provided in).
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.
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
.