linear_interpolation_with_time_limit {realTimeloads}R Documentation

Linearly interpolate timeseries time(x) onto new timesetep ti

Description

Linear interpolation limited by time since previous or following reading

Usage

linear_interpolation_with_time_limit(time, x, ti, threshold)

Arguments

time

time for x (time, POSIXct)

x

any quantity, for example discharge (double)

ti

time where time(x) will be interpolated to (time, POSIXct)

threshold

maximum duration where interpolation is allowed (hours)

Value

a data frame with time (ti), x interpolated from time(x) onto ti, and logical (ibad) if interpolation exceeded threshold

Author(s)

Daniel Livsey (2023) ORCID: 0000-0002-2028-6128

References

Dowle M, and others (2023). data.table: Extension of 'data.frame'. https://cran.r-project.org/web/packages/data.table

Examples

InputData <- realTimeloads::ExampleData
ADCP <- InputData$ADCP
Height <- InputData$Height
# Interpolate river height to ADCP time
time <- realTimeloads::ExampleData$Height$time
x <- realTimeloads::ExampleData$Height$Height_m
ti <-realTimeloads::ExampleData$ADCP$time
threshold <- 1
Output<- linear_interpolation_with_time_limit(time,x,ti,threshold)

[Package realTimeloads version 1.0.0 Index]