Learn R Programming

swfscAirDAS (version 0.3.1)

airdas_process: 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 character airdas_process(x, ...)

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

# S3 method for 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, ... )

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/conditionColumn nameNotes
On/off effortOnEffortTransect code
TransBeaufort sea stateBft
Percent overcast (cloud cover)CCoverJellyfish code
Jellynot in PHOCOENA dataHorizontal sun (clock system)
HorizSunVertical sun (clock system)VertSun
only in PHOCOENA dataHaze/Kelp/Red tide codeHKR
Haze (from HKR code)HazeKelp (from HKR code)
KelpRed tide (from HKR code)RedTide
Altitude (feet)AltFtSpeed (knots)
SpKnotLeft observerObsL
Belly observerObsBRight observer
ObsRData recorderRec
Viewing condition - left insideVLIViewing condition - left outside
VLOViewing condition - bellyVB
Viewing condition - right insideVRIViewing condition - right outside

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

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

Examples

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

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

Run the code above in your browser using DataLab