makeReceiverPlot: make a plot of tag detections and status of antennas

View source: R/makeReceiverPlot.R

makeReceiverPlotR Documentation

make a plot of tag detections and status of antennas

Description

The plot is an object of class trellis which can then be sent to an open plotting device using print(). Note: only detections with valid timestamps, i.e. after 1 Jan 2010, are shown.

Usage

makeReceiverPlot(recv, meta = NULL, title = "", condense = 3600,
  ts = NULL, monoBN = NULL, antCol = c("#000000", "#0000ff", "#20bd00",
  "#a617b8", "#fb7402", "#11d0e1", "#18770b", "#e7c00a", "#ff0000", "#5eff00",
  "#a5a5a5"))

Arguments

recv

path or dplyr::src_sqlite to the receiver database

meta

path or dplyr::src_sqlite to the file with metadata; if NULL (the default), assume metadata tables are in the database given by recv

title

additional title to identify plot, beyond receiver serial number

condense

double scalar; if not NULL, specifies the condensation period: only the first detection of a given tag on a given antenna per condensation period is plotted. Default: 3600, meaning at most one detection of each tag on each antenna is shown per hour, and it will be the first for that hour.

ts

double vector of length 2; range of timestamps to plot; Default: NULL, meaning no restriction on timestamps.

monoBN

integer vector of length 2; range of boot sessions to plot; Default: NULL, meaning no restriction on boot sessions.

antCol

colours to use for each antenna, beginning with antenna number 0. Antenna numbers run from 0 to 10, so at most the first 11 elements are used.

Default: c( "#000000", ## black "#0000ff", ## blue "#20bd00", ## green "#a617b8", ## purple "#fb7402", ## orange "#11d0e1", ## cyan "#18770b", ## dark green "#e7c00a", ## gold "#ff0000", ## red "#5eff00", ## yellow green "#a5a5a5" ## gray )

Details

If both ts and monoBN are NULL, then all detections in database recv are plotted.

Value

a list with these items:

  • width: recommended plot width, in pixels

  • height: recommended plot height, in pixels

  • plot: object of class trellis; to generate a plot from this:

    • open a graphics device, using the recommended width and height

    • print the plot

    • close the device

  • data: dataframe of the data plotted, with these columns

    • ant: antenna number

    • fullID full tag ID, or " Antenna N Status"; the latter 'detections' just indicate the antenna was functioning in the hour centred on the timestamp. Also, a fullID of " Reboot Odometer" indicate the approximate timestamps at which the receiver rebooted, and the ant field for these records is the last digit of the boot session count.

    • bin: the bin number for condensation

    • ts: the timestamp at the start of the condensation bin

    • n: the number of detections (will be at least 1)

    • freq: the mean offset frequency of detections

    • sig: the maximum signal strength

    However, if no data are available for the specified ts and monoBN parameters, then the function returns NULL.

    Note: n, freq, and sig are for the given tag and antenna during the condensation period.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


MotusWTS/motusServer documentation built on Aug. 8, 2024, 10:23 p.m.