interpolate_sensor_offset: Interpolate sensor offsets

View source: R/utils.R

interpolate_sensor_offsetR Documentation

Interpolate sensor offsets

Description

Interpolate sensor offsets

Usage

interpolate_sensor_offset(
  con,
  location,
  t_bnds,
  interpol = "linear",
  fill.array = TRUE
)

Arguments

con

Database connection object, as returned by dbpf_con()

location

a character vector with one or more site names

t_bnds

a vector of POSIXct times for which estimates of vertical sensor offset are desired.

interpol

one of ('constant', 'linear'). Passed to the interpolation function. 'Constant' interpolation results in step-changes whereas 'linear' yields linear interpolation (default).

fill.array

logical, whether or not locations that lack stick-up height measurements should be added to the array with NA values for all time. Defaults to true.

Value

a data.frame whose first column is equal to the time values specified by t_bnds. All other colummns are the time-dependent sensor offsets for each of the station locations specified by the location parameter

Examples

## Not run: 
con <- dbpf_con()
loc <- c("NGO-DD-1005","NGO-DD-1006")
t_s <- as.POSIXct('2015-07-24 12:30:00', format='%Y-%m-%d %H:%M:%S')
t_e <- as.POSIXct('2017-09-24 12:30:00', format='%Y-%m-%d %H:%M:%S')
t_bn <- seq(t_s, t_e, by=3600*24)
offsets <- interpolate_sensor_offset(con, loc, t_bn)

## End(Not run)

geocryology/PermafrostDB documentation built on April 17, 2025, 11:54 a.m.