old/classes_and_methods.md

Notes on the design of the telemetry package

These are some basic notes on how and why the telemetry package was designed the way it was. These are mostly intended for the package authors, but are included here in case it is of interest to anyone else. These notes should outline the thought process in designing the package, as well as provide an overview of the major pieces.

Motivation

Telemetry data from riverine systems typically has similar structure, and the steps needed to get it analysis-ready are likewise similar. Rather than having each project use one-off or sub-optimal code to get the data from it's raw state to its analysis-ready state, we looked to have a unified framework.

One of the biggest motivations is to be able to take data from various different systems (e.g. different tag manufacturers, array setups, etc.), and be able to use the same basic functions.

Data characteristics

The goal is to have an R object which incapsulates a single telemetry "study", hence it is worth exploring what we mean by "study" in this context. For the purposes of this package, a study does not refer to a single deployment, etc. Rather, we mean:

Notice that in this context, a "study" can span many years, can include different species of fish, etc. The important point is these two requirements form a consistent dataset which can be encapsulated into a single R object.

Package design

To accomplish this, we need to be able to convert data from various sources into a unified data structure (the telemetry class). The details for how to convert each raw data type to this unified structure can be accomplished via specialized functions.

Once in the telemetry class, the functions for QA/QC and verification can be used without worrying about:

The telemetry class

Central to this effort is the telemetry class. Telemetry data for riverine deployments typically have the following tables:

A telemetry object contains each of these pieces of information into a single R object. This allows us to:

  1. keep all the data objects related to each other bundled together

  2. pass all required tables into functions in a single object

  3. keep track of meta-data, such as if the data have been QA/QC-ed

Thus, an object of class telemetry consists of:

* Upon creation of the class, most of the data fields will be checked for naming and type consistency. However, these additional meta data will be free-form and can take whatever form the user wants.

QA/QC taken at telemetry object creation

The following steps will be taken when the telemetry object is created, as they will lead to invalid data (i.e. if the goal is a telemetry object consists of data from a certain experiment, it cannot by definition contain other data):

Violations of these will require the user to correct before coercing the data to the telemetry class. We will provide functions to assist in finding these issues.

The advantage of this is that any valid telemetry object is ensured to conform to the above criteria. This significantly reduces the mental overhead in tracking QA/QC status.

Methods

Once in the telemetry class, the following methods will be available:

QA/QC functions:

These steps do not invalidate a telemetry object, and therefore are taken after the object has been created.

After each of these has been conducted on the telemetry object, the appropriate meta data will be set, recording the status in the object itself. This will eliminate guessing which steps have been taken.

Summary functions:

Plotting functions:

Misc functions:

Modeling functions: (other package)



fishsciences/telemetry documentation built on May 31, 2024, 10:13 a.m.