regularize_vpts {bioRad} | R Documentation |
Regularize a time series of vertical profiles (vpts
) on a
regular time grid
Description
Projects objects of class vpts
on a regular time grid
Usage
regularize_vpts(
ts,
interval = "auto",
date_min,
date_max,
units = "secs",
fill = TRUE,
verbose = TRUE,
keep_datetime = FALSE
)
Arguments
ts |
An object inheriting from class |
interval |
Time interval grid to project on. When ' |
date_min |
Start time of the projected time series, as a POSIXct object.
Taken from |
date_max |
End time of the projected time series, as a POSIXct object.
Taken from |
units |
Optional units of |
fill |
Numeric or Logical. fill each regularized timestep with the closest
original profile found within a time window of +/- |
verbose |
Logical, when |
keep_datetime |
Logical, when |
Details
Projects objects of class vpts
on a regular time grid, and fills
temporal gaps by nearest neighbor interpolation.
Irregular time series of profiles are typically aligned on a
regular time grid with the expected time interval at which a radar provides
data. Alignment is performed using a nearest neighbor interpolation limited to
neighboring profiles that fall within +/- fill
(centered) of an original profile.
In plots of regular time series (see plot.vpts()
) temporal gaps of
missing profiles (e.g. due to radar down time) become visible. In irregular
time series data points in the plot are carried through until the time series
continues, and temporal data gaps are filled up visually.
Value
An object of class vpts
with regular time steps.
Examples
# start form example vpts object:
data(example_vpts)
ts <- example_vpts
# regularize the time series on a 5 minute interval grid
tsRegular <- regularize_vpts(ts, interval = 300)
# regularize the time series on a 10 minute interval grid,
# and fill data gaps smaller than 1 hour by nearest neighbor interpolation
tsRegular <- regularize_vpts(ts, interval = 600, fill = 3600)