airdas_process: Process aerial survey DAS data

View source: R/airdas_process.R

airdas_processR Documentation

Process aerial survey DAS data

Description

Process AirDAS data (the output of airdas_read), including extracting state and condition information for each AirDAS event

Usage

airdas_process(x, ...)

## S3 method for class 'character'
airdas_process(x, ...)

## S3 method for class 'data.frame'
airdas_process(x, ...)

## S3 method for class 'airdas_dfr'
airdas_process(
  x,
  days.gap.part = 0.5/24,
  days.gap.full = 12/24,
  gap.message = FALSE,
  reset.transect = TRUE,
  trans.upper = FALSE,
  ...
)

Arguments

x

an object of class airdas_dfr object, an object that can be coerced to class airdas_dfr, or a character (filepath) which is first passed to airdas_read

...

passed to airdas_read if x is a character. Otherwise ignored

days.gap.part

numeric of length 1; time gap (in days) used to identify when a 'partial reset' is performed, i.e. when propagated info (weather, observers, etc) is reset. Default is 30 minutes; must be less than or equal to days.gap.full

days.gap.full

numeric of length 1; time gap (in days) used to identify when a 'full reset; is performed, i.e. when all info (transect number and propagated info) is reset. Default is 12 hours; must be greater than days.gap.part

gap.message

logical; default is FALSE. Indicates if messages should be printed detailing which row(s) of the output data frame were partially or fully reset

reset.transect

logical; default is TRUE. Indicates if propagated info (weather, observers, etc) should be reset to NA when beginning a new transect. See Details section

trans.upper

logical; indicates if all transect codes should be capitalized using toupper. Default is FALSE

Details

If x is a character, it is assumed to be a filepath and first passed to airdas_read. This output is then processed.

This function cannot handle concatenated airdas_dfr objects of multiple file types. In other words, AirDAS data must be processed and then concatenated.

AirDAS data is event-based, meaning most events indicate when a state or weather condition changes. For instance, a 'W' event indicates when one or more weather conditions (such as Beaufort sea state) change, and the weather conditions are the same for subsequent events until the next 'W' event. For each state/condition: a new column is created, the state/condition information is extracted from relevant events, and extracted information is propagated to appropriate subsequent rows (events). Thus, each row in the output data frame contains all pertinent state/condition information for that row.

The following assumptions/decisions are made during processing:

  • All '#' events (deleted events) are removed

  • 'DateTime', 'Lat', and 'Lon' information are added to '1' events where applicable

  • Effort is determined as follows: T/R events turns effort on, and O/E events turn effort off. T/R events themselves will be on effort, while O/E events will be off effort. The 'EffortDot' column is ignored

  • 'HKR' values are converted to lower case. "Y" values are considered to be "H" values

  • Observer ('ObsL', 'ObsB', 'ObsR', 'Rec') values are converted to lower case

  • Viewing condition ('VLI', 'VLO', 'VB', 'VRI', 'VRO') values are converted to lower case

  • Missing values are NA rather than -1

Normally, a T event (to indicate starting/resuming a transect) is immediately followed by a VPAW event series, creating a TVPAW event series. The reset.transect argument causes the conditions set in the VPAW event series (Beaufort, viewing conditions, altitude, etc.) to be reset to NA at each T event

Value

An airdas_df object, which is also a data frame. It consists of the input data frame, i.e. the output of airdas_read, with the following columns added:

State/condition Column name Notes
On/off effort OnEffort
Transect code Trans
Beaufort sea state Bft
Percent overcast (cloud cover) CCover
Jellyfish code Jelly not in PHOCOENA data
Horizontal sun (clock system) HorizSun
Vertical sun (clock system) VertSun only in PHOCOENA data
Haze/Kelp/Red tide code HKR
Haze (from HKR code) Haze
Kelp (from HKR code) Kelp
Red tide (from HKR code) RedTide
Altitude (feet) AltFt
Speed (knots) SpKnot
Left observer ObsL
Belly observer ObsB
Right observer ObsR
Data recorder Rec
Viewing condition - left inside VLI
Viewing condition - left outside VLO
Viewing condition - belly VB
Viewing condition - right inside VRI
Viewing condition - right outside VRO

See airdas_format_pdf for which data columns the condition information is extracted form for each file type. In addition, warnings are printed with line numbers of unexpected event codes

Examples

y <- system.file("airdas_sample.das", package = "swfscAirDAS")
airdas_process(y, trans.upper = FALSE)

y.read <- airdas_read(y)
airdas_process(y.read)


swfscAirDAS documentation built on Aug. 9, 2023, 1:06 a.m.