
Adjust return period uncertainty ranges without overlap
prepare_flood_range.RdAdjust consecutive return period uncertainty ranges to prevent any overlap by setting consecutive limits to their midpoint, and return the data frame with absolute values.
Value
Updated data.frame with absolute min and max bounds without
overlap, preserving the original row order of uncertainty.
Details
The function converts any relative bounds (type == "relative") into
absolute values based on nominal (nominal * (1 + bound)). It sorts return
periods in ascending order and verifies consecutive ranges.
If consecutive ranges overlap (the upper bound max of an event exceeds the
lower bound min of the immediately higher event), these consecutive bounds
are adjusted to their midpoint:
mid = (max_i + min_{i+1}) / 2 (using pmin on max and pmax on min).
The returned data.frame always has type = "absolute".
The original row order of the input uncertainty table is strictly preserved
in the output.
Author
Frédéric Grelot, frederic.grelot.1994_cran@m4x.org