View source: R/regularize_vpts.R
regularize_vpts | R Documentation |
vpts
) on a
regular time gridProjects objects of class vpts
on a regular time grid
regularize_vpts(
ts,
interval = "auto",
date_min,
date_max,
units = "secs",
fill = TRUE,
verbose = TRUE,
keep_datetime = FALSE
)
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 |
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.
Remaining temporal gaps in the time series are filled with empty profiles that have values NA for all quantities, such that each timestamp of the regular grid has an associated profile.
In plots of regular time series (see plot.vpts()
) temporal gaps of
missing profiles (e.g. due to radar down time) become visible, as a result
of the gap filling with empty profiles. 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.
When keep_datetime
is TRUE
the original profile timestamps are kept in
ts$datetime
. This may lead to duplicate timestamps when regularizing on a timegrid
finer than the interval of available profiles.
An object of class vpts
with regular time steps.
# start form example vpts object:
data(example_vpts)
ts <- example_vpts
# data gaps are not visible:
plot(ts)
# regularize the time series on a 5 minute interval grid
tsRegular <- regularize_vpts(ts, interval = 300)
# data gaps are visible:
plot(tsRegular)
# 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)
# data gaps are smaller as a result of nearest neighbor interpolation:
plot(tsRegular)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.