getYearProjSite: Get project and site names, given a receiver serial number...

View source: R/getYearProjSite.R

getYearProjSiteR Documentation

Get project and site names, given a receiver serial number and a time range or bootnum range.

Description

This is meant to provide project and site labels for plots and summary files. Either a time range (tsLo, tsHi) or a boot number range (bnLo, bnHi) must be provided, but not both.

Usage

getYearProjSite(serno, ts = NULL, bn = NULL, motusProjectID = NULL)

Arguments

serno

character vector of serial numbers

ts

numeric vector of length 2; start and end time

bn

integer vector of length 2; start and end boot session numbers; ignored if serno is a Lotek receiver.

motusProjectID

integer scalar; motus project ID to use in case no deployments found for this receiver.

Details

If a time range is provided, all deployments that overlap the specified time range are returned, and the range of timestamps for these deployments is returned in the tsStart, tsEnd fields.

If a boot session range is provided and the receiver is a sensorgnome, all deployments that include the specified boot session range are returned, and the range of boot sessions from these is returned in the bnStart, bnEnd fields. It is assumed the caller has obtained a lock on that receiver's DB, via lockSymbol(serno).

In either case, if the receiver is a SensorGnome, the return value includes valid bnStart and bnEnd - the range of boot sessions corresponding to the corresponding receiver deployment.

Value

a data.frame with these columns:

  • serno receiver serial number

  • year integer year deployment began

  • proj name of project

  • site name of receiver deployment

  • projID id of project

  • tsStart timestamp at which this deployment begins

  • tsEnd timestamp at which this deployment ends

  • bnStart boot number at which this deployment begins

  • bnEnd boot number at which this deployment ends

Returns NULL if neither bn nor ts is specified.

If there were no matching deployment records, and no motus project is given, then the catch-all project 0 is used.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm

See Also


MotusWTS/motusServer documentation built on Oct. 13, 2024, 7:31 p.m.