getTrackSegments {moveWindSpeed}R Documentation

An helper function to extract trajectory segments for wind estimation from a track

Description

An helper function to extract trajectory segments for wind estimation from a track

Usage

getTrackSegments(
  data,
  timestamps,
  windowSize = 29,
  isFocalPoint = function(i, ts) {
     TRUE
 },
  isSamplingRegular = 1,
  focalSampleBefore = 0
)

Arguments

data

A two column dataframe.

timestamps

A series of POSIXct timestamps as long as the data.

windowSize

The window size (odd number) or two numbers giving the start and end of a window around a focal point.

isFocalPoint

an function taking location numbers and timestamps that is used to see if a location should be considered as an focal point. It can for example be used to speed up calculations by only considering every second location. An numeric value can also be provided then only these locations are considered

isSamplingRegular

Either an numeric or a function that is used to decide if a series of timestamps is regular. If numeric than it should correspond to the interval in seconds.

focalSampleBefore

An argument to be used if data is not the start of the location count.

Value

A list of ground speeds

Examples

length(getTrackSegments(data.frame(1:40,1:40), Sys.time()+1:40))
length(getTrackSegments(data.frame(1:40,1:40), Sys.time()+c(1:25,36:50), windowSize=11))
str(getTrackSegments(data.frame(1:40,1:40), Sys.time()+1:40, windowSize=39))

[Package moveWindSpeed version 0.2.4 Index]