Projects 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
)

Arguments

ts

An object inheriting from class vpts, see vpts() for details.

interval

Time interval grid to project on. When 'auto' the median interval in the time series is used.

date_min

Start time of the projected time series, as a POSIXct object. Taken from ts by default'.

date_max

End time of the projected time series, as a POSIXct object. Taken from ts by default.

units

Optional units of interval and fill, one of 'secs', 'mins', 'hours','days', 'weeks'. Defaults to 'mins'.

fill

Numeric or Logical. fill each regularized timestep with the closest original profile found within a time window of +/- fill. When TRUE, fill maps to interval, filling single missing timesteps. When FALSE, fill maps to 0, disabling filling.

verbose

Logical, when TRUE prints text to console.

keep_datetime

Logical, when TRUE keep original radar acquisition timestamps.

Value

An object of class vpts with regular time steps.

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.

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)