readArgos: Read Argos "DAT" or "DIAG" files

readArgosR Documentation

Read Argos "DAT" or "DIAG" files

Description

Return a (Spatial) data frame of location records from raw Argos files. Multiple files may be read, and each set of records is appended to the data frame in turn. Basic validation of the data is enforced by default.

Usage

readArgos(
  x,
  correct.all = TRUE,
  dtFormat = "%Y-%m-%d %H:%M:%S",
  tz = "GMT",
  duplicateTimes.eps = 0.01,
  p4 = "+proj=longlat +ellps=WGS84",
  verbose = FALSE,
  read_alt = NULL,
  ...
)

readDiag(x, return_trip = FALSE, read_alt = 1L, ...)

Arguments

x

vector of file names of Argos "DAT" or "DIAG" files.

correct.all

logical - enforce validity of data as much as possible? (see Details)

dtFormat

the DateTime format used by the Argos data "date" and "time" pasted together

tz

timezone - GMT/UTC is assumed

duplicateTimes.eps

what is the tolerance for times being duplicate?

p4

PROJ.4 projection string, "+proj=longlat +ellps=WGS84" is assumed

verbose

if TRUE, details on date-time adjustment is reported

read_alt

is NULL by default, with longitude and latitude read from the PRV message, if 1 or 2 then attempt is made to read the alternative locations (but these are not always present)

...

reserved for future use

return_trip

for readDiag() if TRUE will return a trip object, use read_alt to control the location

Details

readArgos performs basic validation checks for class trip are made, and enforced based on correct.all:

No duplicate records in the data, these are simply removed. Records are ordered by DateTime ("date", "time", "gmt") within ID ("ptt"). No duplicate DateTime values within ID are allowed: to enforce this the time values are moved forward by one second - this is done recursively and is not robust.

If validation fails the function will return a SpatialPointsDataFrame-class. Files that are not obviously of the required format are skipped.

Argos location quality data "class" are ordered, assuming that the available levels is levels=c("Z", "B", "A", "0", "1", "2", "3").

A projection string is added to the data, assuming the PROJ.4 longlat - if any longitudes are greater than 360 the PROJ.4 argument "+over" is added.

readDiag simply builds a data.frame.

With read_alt the default value NULL returns the PRV location as-is. Some files may have a standardized location, and a dummy. If read_alt is set to 1 or 2 the corresponding "alternative" location is returned. 1 is a standardized location corresponding to the original PRV message, and 2 is a "dummy" location.

Value

readArgos returns a trip object, if all goes well, or simply a SpatialPointsDataFrame-class.

readDiag returns a data.frame with 8 columns:

  • lon1,lat1 first pair of coordinates

  • lon1,lat1 second pair of coordinates

  • gmt DateTimes as POSIXct

  • id Platform Transmitting Terminal (PTT) ID

  • lq Argos location quality class

  • iq some other thing

Warning

This works on some Argos files I have seen.

References

The Argos data documentation was (ca. 2003) at http://www.argos-system.org/manual. Specific details on the PRV ("provide data") format were found in Chapter 4_4_8, originally at 'http://www.cls.fr/manuel/html/chap4/chap4_4_8.htm'.

See Also

trip, SpatialPointsDataFrame-class, adjust.duplicateTimes, for manipulating these data, and argos.sigma for relating a numeric value to Argos quality "classes".

sepIdGaps for splitting the IDs in these data on some minimum gap.

order, duplicated, , ordered for general manipulation of this type.

Examples

argosfile <-
  system.file("extdata/argos/98feb.dat", package = "trip", mustWork = TRUE)
argos <- readArgos(argosfile)

mdsumner/trip documentation built on July 7, 2023, 3:50 p.m.