addGps: Add GPS Locations to Data

Description Usage Arguments Details Value Author(s)

Description

Add GPS Lat / Long to a variety of types of data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
addGps(x, gps = NULL, thresh = 3600, ...)

## S4 method for signature 'data.frame'
addGps(x, gps = NULL, thresh = 3600, ...)

## S4 method for signature 'AcousticEvent'
addGps(x, gps = NULL, thresh = 3600, ...)

## S4 method for signature 'list'
addGps(x, gps = NULL, thresh = 3600, ...)

## S4 method for signature 'AcousticStudy'
addGps(x, gps = NULL, thresh = 3600, ...)

## S4 method for signature 'ANY'
addGps(x, gps = NULL, thresh = 3600, ...)

Arguments

x

data to add GPS coordinates to. Must have a column UTC, and can also have an optional column Channel

gps

a data frame of GPS coordinates to match to data from x. Must have columns UTC, Latitude, Longitude, and optionally Channel. If not provided and x is an AcousticEvent or AcousticStudy object, then the gps data will be read from the databases contained in the files slot of xrm(may

thresh

maximum time in seconds for matching GPS coordinates to data.

...

additional arguments for other methods

Details

Latitude and Longitude coordinates will be matched to the data by using data.tables rolling join with roll='nearest'. After the join is done, the time difference between the matched rows is checked and any that are greater than the set threshold are set to NA. This is done to prevent accidentally matching weird things if an incomplete set of GPS data is provided.

If x is an AcousticEvent or AcousticStudy, then gps can be omitted and will be read from the databases contained in the files slot of x. If x is an AcousticStudy, then the gps data will also be saved to the gps slot of the object, and an additional argument bounds can be provided. This is a length two vector of POSIXct class times that will bound the times of gps data to store, gps data outside this range will not be stored (to reduce the potentially very large amount of data stored in the gps slot)

Value

the same data as x, with Lat/Long data added

Author(s)

Taiki Sakai taiki.sakai@noaa.gov


TaikiSan21/PAMr documentation built on Nov. 15, 2020, 9:46 p.m.