fetch_ats_positions: Download GPS Fixes from ATS Website

fetch_ats_positionsR Documentation

Download GPS Fixes from ATS Website

Description

Retrieves GPS data optionally filtered by date, last n positions, or collar

Usage

fetch_ats_positions(
  device_id = NULL,
  start = NULL,
  end = NULL,
  n = NULL,
  new = FALSE,
  chunk_size = 50L
)

Arguments

device_id

A single device id, or a list or vector of device ids, or NULL for all devices associated with current account. Overrides the new parameter when specified. If the device ids returned by fetch_ats_devices have leading zeros they should be included in the device_id parameter as well (e.g. device_id = "012345")).

start, end

Currently ignored (see Notes).

n

A single integer specifying how many fixes to return per collar (sorted by recency). Valid values are 5 and 10.

new

Currently ignored due to changes in the ATS website.

chunk_size

A single integer (default = 50) specifying how many collars are downloaded per HTTP request. In some rare cases entire batches may fail (with a warning) due to a few problematic collars, in which case you should set chunk_size to 1 to ensure that all available data is retrieved.

Value

A tibble with 25 columns:

CollarSerialNumber

ATS Collar ID (character)

,

Year

Two digit year (integer)

,

JulianDay

Julian day (1:366, integer)

,

Hour

Hour (integer)

,

Minute

Minute (integer)

,

Activity

Activity sensor reading (integer)

,

Temperature

Ambient temperature (Celsius, integer)

,

Latitude

Latitude (decimal degrees, numeric)

,

Longitude

Longitude (decimal degrees, numeric)

,

HDOP

Horizontal Dilution of Precision (numeric)

,

NumSats

Number of GPS satellites (integer)

,

FixTime

GPS Fix Time (integer)

,

'2D/3D'

GPS fix dimension (integer)

,

DateOffset

Timestamp from raw data with fixed offset applied (POSIXct)

,

GmtOffset

Offset from GMT in hours, mutliplied by negative one to correct for non-standard ATS usage (numeric)

,

DateUTC

Timestamp in UTC/GMT (POSIXct)

,

DateLocal

Timestamp in current system time zone (POSIXct)

,

VITTemp

VIT temperature (Celsius, integer)

,

VITLight

VIT light sensor reading (integer) (integer)

,

VITComm

VIT communication count (integer)

,

Fawn0Comm

Fawn slot 0 communication count (integer)

,

Fawn1Comm

Fawn slot 1 communication count (integer)

,

Fawn2Comm

Fawn slot 2 communication count (numeric)

,

TransDateUTC

Transmission timestamp in UTC/GMT (POSIXct)

,

TransDateLocal

Transmission timestamp in current system time zone (POSIXct)

Notes

Currently filtering by date is broken on the ATS site - using the date range filters when downloading data returns an internal server error. The functionality is included here in the hopes that it will be fixed in the near future, but currently date filters are ignored.

See Also

ats_login for logging into an ATS account, fetch_ats_config for downloading collar configurations, fetch_ats_transmissions for downloading transmission data, fetch_ats_events for downloading alerts, and link{fetch_ats_devices} for downloading a list of available collars

Examples

## Not run: 

ats_login("mary", ".")

# get undownloaded fixes for all collars in this account
fixes <- fetch_ats_positions(new = TRUE)

# get all fixes for all collars in this account
fixes <- fetch_ats_positions()

# get all fixes for specific collars
collar_list <- sample(fetch_ats_devices(), 10)
fixes <- fetch_ats_positions(collar_list)

# get all fixes for collars in mortality
collar_list <- fetch_ats_devices("mortality")
fixes <- fetch_ats_positions(device_id = collar_list)

# get last 10 fixes for certain collars
fixes <- fetch_ats_positions(device_id = collar_list, n = 10)

# get fixes in 2019 for all collars
fixes <- fetch_ats_positions(
  start = as.POSIXct("2019-01-01"),
  end = as.POSIXct("2020-01-01")
)

# get fixes in 2019 for certain collars
fixes <- fetch_ats_positions(
  device_id = collar_list,
  start = as.POSIXct("2019-01-01"),
  end = as.POSIXct("2020-01-01")
)

# get fixes for a single collar
fixes <- fetch_ats_positions("044286")

# set chunk_size to 1 to ensure you get all available data
#   if you're experiencing issues, but the download will
#   take much longer to complete.
fixes <- fetch_ats_positions(chunk_size = 1)

ats_logout()


## End(Not run)


Huh/collar documentation built on Aug. 5, 2022, 11:02 p.m.