Skip to contents

Finds the time index when a certain percentage of total snowmelt volume has been reached.

Usage

compute_tVolSnowmelt(
  Q,
  p,
  d = 5,
  w = 0.9,
  a = 0.925,
  passes = 3,
  method = "Wal"
)

Arguments

p

Numeric (0-1) specifying target progress percentage

Value

Integer index when cumulative snowmelt reaches p% of total volume.

Details

Computes:

  1. Cumulative sum of baseflow (snowmelt)

  2. Normalizes to 0-1 range

  3. Finds closest time index to target percentage p

See also

compute_VolSnowmelt for total volume calculation

Examples

Q <- c(10,15,20,18,12,8,5,7,9,12)
# Find when 50% of snowmelt has occurred:
compute_tVolSnowmelt(Q, p=0.5) 
#> [1] NA