Extract sighting information from aerial DAS data
Usage
airdas_sight(x, ...)
# S3 method for class 'data.frame'
airdas_sight(x, ...)
# S3 method for class 'airdas_df'
airdas_sight(x, angle.min = 12, ...)
Arguments
- x
airdas_df
object; output fromairdas_process
, or a data frame that can be coerced to aairdas_df
object- ...
ignored
- angle.min
numeric; the minimum (absolute value) angle for which to consider a sighting a standard sighting. Default is 12
Value
Data frame with 1) the columns from x
, excluding the 'Data#' columns,
and 2) columns with sighting information extracted from 'Data#' columns as described below.
The data frame has one row for each sighting, or one row for each
species of each sighting if it is a multi-species (mixed) sighting.
Added sighting information columns:
Sighting information | Column name | Notes |
Sighting number | SightNo | Observer that made the sighting |
Obs | Angle of declination | Angle |
Left is negative | Sighting by standard observer | ObsStd |
Logical; described in Details | Standard sighting | SightStd |
Logical; described in Details | Mixed species sighting | Mixed |
Logical | Species code | SpCode |
All characters converted to lower case | Group size of school | GsTotal |
Only different from GsSp for mixed species sightings | Group size of species | GsSp |
Turtle length (feet if numeric) | TurtleSize | NA for non-"t" events; may be character or numeric |
Turtle travel direction (degrees) | TurtleDirection | NA for non-"t" events |
Turtle tail visible? | TurtleTail | NA for non-"t" events |
The TurtleSize will be of class character is there is any
CARETTA data in x
, and of class numeric otherwise.
Details
AirDAS events contain specific information in the 'Data#' columns,
with the information depending on the event code and file type for that row.
This function extracts relevant data for sighting events, and returns a
data frame with dedicated columns for each piece of sighting information.
It can handle multiple file types in x
; for instance,
x
could be processed PHOCOENA and TURTLE data
combined using rbind
.
See airdas_format_pdf
for more information about the expected
events and event formats, depending on the file type.
All species codes are converted to lower case using tolower
.
Abbreviations used in column names include: Gs = group size, Sp = species,
Mixed = mixed species (multi-species) sighting.
In addition, note that multi-species group sizes are rounded to
the nearest whole number using round(, 0)
A 'sighting by a standard observer' ('ObsStd') is a sighting
made by ObsL, ObsB, ObsR, ObsLR, or ObsRR (not the data recorder or pilot).
A 'standard sighting' ('SightStd') is a sighting
that was made while on effort, by a standard observer,
and with the absolute value of the angle of declination
being greater than or equal to angle.min
.
Resights (Events 's') are not considered standard events,
and thus both 'ObsStd' and 'SightStd' will be NA
for 's' events.
Examples
y <- system.file("airdas_sample.das", package = "swfscAirDAS")
y.proc <- airdas_process(y)
airdas_sight(y.proc)
#> Event DateTime Lat Lon OnEffort Trans Bft CCover Jelly
#> 1 S 2015-04-09 12:31:35 39.23367 -123.1783 TRUE T1 1 10 0
#> 2 S 2015-04-09 12:31:47 39.23350 -123.1857 TRUE T1 1 10 0
#> 3 S 2015-04-09 12:31:56 39.23333 -123.1917 TRUE T1 1 10 0
#> 4 S 2015-04-09 12:32:20 39.23233 -123.2053 TRUE T1 1 10 0
#> 5 S 2015-04-09 12:32:30 39.23233 -123.2108 TRUE T1 1 10 0
#> 6 S 2015-04-09 12:32:42 39.23233 -123.2195 TRUE T1 1 10 0
#> 7 S 2015-04-09 12:32:42 39.23233 -123.2195 TRUE T1 1 10 0
#> 8 S 2015-04-09 12:33:43 39.23333 -123.2550 TRUE T1 1 10 0
#> 9 S 2015-04-09 12:35:13 39.23317 -123.3073 TRUE T1 1 10 2
#> 10 S 2015-04-09 12:36:13 39.23333 -123.3418 TRUE T1 1 10 2
#> 11 S 2015-04-09 12:36:26 39.23350 -123.3500 TRUE T1 1 10 2
#> 12 t 2015-04-09 12:36:26 39.23350 -123.3500 TRUE T1 1 10 2
#> 13 S 2015-04-09 12:36:43 39.23350 -123.3592 TRUE T1 1 10 2
#> 14 S 2015-04-09 12:37:01 39.23400 -123.3697 TRUE T1 1 10 2
#> 15 S 2015-04-09 12:37:16 39.23433 -123.3790 TRUE T1 1 10 2
#> 16 S 2015-04-09 12:37:37 39.23417 -123.3910 TRUE T1 1 10 2
#> 17 S 2015-04-09 12:42:13 39.23250 -123.5515 TRUE T1 1 20 0
#> 18 S 2015-04-09 12:51:40 39.21750 -123.4410 TRUE T2 1 20 0
#> 19 S 2015-04-09 12:51:55 39.21750 -123.4317 TRUE T2 1 20 0
#> 20 S 2015-04-09 12:52:03 39.21733 -123.4270 TRUE T2 1 20 0
#> 21 S 2015-04-09 12:52:04 39.21733 -123.4270 TRUE T2 1 20 0
#> 22 S 2015-04-09 12:52:07 39.21733 -123.4258 TRUE T2 1 20 0
#> 23 S 2015-04-09 12:52:17 39.21700 -123.4185 TRUE T2 1 20 0
#> 24 S 2015-04-09 12:52:54 39.21700 -123.3982 TRUE T2 1 20 0
#> 25 S 2015-04-09 12:54:34 39.21667 -123.3422 TRUE T2 2 20 0
#> 26 S 2015-04-09 12:55:20 39.21700 -123.3172 TRUE T2 2 20 0
#> 27 S 2015-04-09 12:56:49 39.21717 -123.2685 TRUE T2 2 20 0
#> 28 s 2015-04-09 12:57:00 39.21700 -123.2617 TRUE T2 2 20 0
#> HorizSun VertSun HKR Haze Kelp RedTide AltFt SpKnot ObsL ObsB ObsR Rec
#> 1 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 2 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 3 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 4 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 5 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 6 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 7 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 8 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 9 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 10 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 11 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 12 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 13 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 14 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 15 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 16 6 NA r FALSE FALSE TRUE 650 100 aa bb cc dd
#> 17 6 NA n FALSE FALSE FALSE 650 100 aa bb cc dd
#> 18 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 19 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 20 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 21 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 22 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 23 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 24 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 25 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 26 12 NA n FALSE FALSE FALSE 680 90 aa dd cc bb
#> 27 12 NA r FALSE FALSE TRUE 680 90 aa dd cc bb
#> 28 12 NA r FALSE FALSE TRUE 680 90 aa dd cc bb
#> ObsLR ObsRR VLI VLO VB VRI VRO EffortDot EventNum file_das line_num
#> 1 <NA> <NA> g g g g g TRUE 9 airdas_sample.das 9
#> 2 <NA> <NA> g g g g g TRUE 10 airdas_sample.das 10
#> 3 <NA> <NA> g g g g g TRUE 12 airdas_sample.das 12
#> 4 <NA> <NA> g g g g g TRUE 14 airdas_sample.das 14
#> 5 <NA> <NA> g g g g g TRUE 15 airdas_sample.das 15
#> 6 <NA> <NA> g g g g g TRUE 16 airdas_sample.das 16
#> 7 <NA> <NA> g g g g g TRUE 16 airdas_sample.das 16
#> 8 <NA> <NA> g g g g g TRUE 18 airdas_sample.das 19
#> 9 <NA> <NA> g g g g g TRUE 23 airdas_sample.das 24
#> 10 <NA> <NA> g g g g g TRUE 26 airdas_sample.das 27
#> 11 <NA> <NA> g g g g g TRUE 27 airdas_sample.das 28
#> 12 <NA> <NA> g g g g g TRUE 28 airdas_sample.das 29
#> 13 <NA> <NA> g g g g g TRUE 29 airdas_sample.das 30
#> 14 <NA> <NA> g g g g g TRUE 31 airdas_sample.das 32
#> 15 <NA> <NA> g g g g g TRUE 32 airdas_sample.das 33
#> 16 <NA> <NA> g g g g g TRUE 34 airdas_sample.das 35
#> 17 <NA> <NA> g g g g g TRUE 46 airdas_sample.das 47
#> 18 <NA> <NA> g g g g g TRUE 65 airdas_sample.das 66
#> 19 <NA> <NA> g g g g g TRUE 66 airdas_sample.das 67
#> 20 <NA> <NA> g g g g g TRUE 68 airdas_sample.das 69
#> 21 <NA> <NA> g g g g g TRUE 69 airdas_sample.das 70
#> 22 <NA> <NA> g g g g g TRUE 70 airdas_sample.das 71
#> 23 <NA> <NA> g g g g g TRUE 71 airdas_sample.das 72
#> 24 <NA> <NA> g g g g g TRUE 73 airdas_sample.das 74
#> 25 <NA> <NA> g g p g g TRUE 78 airdas_sample.das 79
#> 26 <NA> <NA> g g p g g TRUE 80 airdas_sample.das 81
#> 27 <NA> <NA> g g p g g TRUE 84 airdas_sample.das 85
#> 28 <NA> <NA> g g p g g TRUE 86 airdas_sample.das 87
#> file_type SightNo Obs Angle ObsStd SightStd Mixed SpCode GsTotal GsSp
#> 1 turtle 1 cc 67 TRUE TRUE FALSE mn 6 6
#> 2 turtle 2 bb -60 TRUE TRUE FALSE mn 6 6
#> 3 turtle 3 cc 38 TRUE TRUE FALSE mn 2 2
#> 4 turtle 4 aa -50 TRUE TRUE FALSE mn 5 5
#> 5 turtle 5 cc 49 TRUE TRUE FALSE bm 4 4
#> 6 turtle 6 cc 42 TRUE TRUE TRUE gg 10 8
#> 7 turtle 6 cc 42 TRUE TRUE TRUE er 10 2
#> 8 turtle 7 aa -53 TRUE TRUE FALSE bm 5 5
#> 9 turtle 8 dd 24 FALSE FALSE FALSE bm 2 2
#> 10 turtle 9 aa -57 TRUE TRUE FALSE mn 4 4
#> 11 turtle 10 cc 65 TRUE TRUE FALSE gg 5 5
#> 12 turtle <NA> aa -20 TRUE TRUE FALSE dc 1 1
#> 13 turtle 11 bb 87 TRUE TRUE FALSE pp 3 3
#> 14 turtle 12 bb 82 TRUE TRUE FALSE gg 5 5
#> 15 turtle 13 bb 54 TRUE TRUE FALSE pp 6 6
#> 16 turtle 14 cc 62 TRUE TRUE FALSE gg 2 2
#> 17 turtle 15 bb 50 TRUE TRUE FALSE mn 3 3
#> 18 turtle 16 aa -31 TRUE TRUE FALSE mn 6 6
#> 19 turtle 17 bb -59 FALSE FALSE FALSE bm 6 6
#> 20 turtle 18 aa -62 TRUE TRUE FALSE gg 2 2
#> 21 turtle 19 cc 42 TRUE TRUE FALSE bm 3 3
#> 22 turtle 20 aa -48 TRUE TRUE FALSE bm 4 4
#> 23 turtle 21 cc 63 TRUE TRUE FALSE pp 6 6
#> 24 turtle 22 cc 43 TRUE TRUE FALSE pp 2 2
#> 25 turtle 23 cc 56 TRUE TRUE FALSE mn 6 6
#> 26 turtle 24 cc 37 TRUE TRUE FALSE mn 6 6
#> 27 turtle 25 bb -76 FALSE FALSE FALSE pp 1 1
#> 28 turtle 25 <NA> -70 NA NA NA <NA> NA NA
#> TurtleSize TurtleDirection TurtleTail
#> 1 NA NA <NA>
#> 2 NA NA <NA>
#> 3 NA NA <NA>
#> 4 NA NA <NA>
#> 5 NA NA <NA>
#> 6 NA NA <NA>
#> 7 NA NA <NA>
#> 8 NA NA <NA>
#> 9 NA NA <NA>
#> 10 NA NA <NA>
#> 11 NA NA <NA>
#> 12 5 90 n
#> 13 NA NA <NA>
#> 14 NA NA <NA>
#> 15 NA NA <NA>
#> 16 NA NA <NA>
#> 17 NA NA <NA>
#> 18 NA NA <NA>
#> 19 NA NA <NA>
#> 20 NA NA <NA>
#> 21 NA NA <NA>
#> 22 NA NA <NA>
#> 23 NA NA <NA>
#> 24 NA NA <NA>
#> 25 NA NA <NA>
#> 26 NA NA <NA>
#> 27 NA NA <NA>
#> 28 NA NA <NA>