distribPrecip: Distributes precipitation in time

Description Usage Arguments Value Author(s) See Also Examples

View source: R/distribPrecip.R

Description

MESH requires all forcing data to have the same time interval, which prevents the use of precipitation data reported at lower frequencies than the model time step. This function distributes low-freqency precipitation (e.g. daily) according to a set of high frequency precipitation (e.g. hourly). The high-frequency values are summed to have the same time intervals as the low-frequency data. The ratios of low/high freqency precipitations are determined for each time step, and these ratios are multiplied by the high-frequency data. Where the high-frequency total precipitation is zero, the low-frequency data is spread evenly over the high-frequency interval.

Usage

1
2
3
4
5
6
distribPrecip(
  LFprecip = NULL,
  HFprecip = NULL,
  zero_missing_HF = TRUE,
  period_threshold = 48
)

Arguments

LFprecip

Required. A data frame of low temporal frequency (e.g. daily) precipitation. The first column must be a POSIXct date/time called datetime. The second column must be the precipitation.

HFprecip

Required. A data frame of high temporal frequency (e.g. hourly) precipitation. The first column must be a POSIXct date/time called datetime. The second column must be the precipitation.

zero_missing_HF

Optional. If TRUE (the default) missing high-frequency precipitation values are replaced with zeros.

period_threshold

Length of maximum infilled period in hours. Sequences of missing low-frequency values exceeding this length will be set to NA_real_, and the next low-frequency value will be assigned to the next high frequency interval. This is usually required when a gauge is not reported for a seasonal period.

Value

Returns a data frame of the adjusted high-frequency precipitation, with the variables datetime and distributedP. Note that the last date/time in the returned data corresponds to the final value in the low-frequency data.

Author(s)

Kevin Shook

See Also

read_tb0

Examples

1
2
3
4
## Not run: distributed <- distribPrecip(myPrecip[, c(1, 5)], 
adjacentP)

## End(Not run)

CentreForHydrology/MESHr documentation built on Jan. 11, 2021, 8:34 p.m.