aggregate_obs {dynatopmodel} | R Documentation |
Takes a list of time series and resample to a new interval.
aggregate_obs(obs, dt, is.rate = TRUE)
obs |
List of times series (zoo) objects with a POSIXct index. |
dt |
New time interval, hours. |
is.rate |
If TRUE then these are rates i.e m/hr. Otherwise they are absolute values across the interval and are scaled before return by a factor equal to the ratio of the old interval to the new interval. |
Time series of observation data are often of different temporal resolutions, however the input to most hydrological models, as is the case with the Dynamic TOPMODEL, requires those data at the same interval. This provides a method to resample a collection of such data to a single interval.
The list of observations resampled at the new interval.
# Resample Brompton rainfall and PE data to 15 minute intervals require(dynatopmodel) data("brompton") obs <- aggregate_obs(list("rain"=brompton$rain, "pe"=brompton$pe), dt=15/60) # check totals for Sept - Oct 2012 sum(obs$rain*15/60, na.rm=TRUE) sum(brompton$rain, na.rm=TRUE)