ECSAS.find.suspicious.posn: Find ECSAS watches with suspicious positions

View source: R/ECSAS.find.suspicious.posn.R

ECSAS.find.suspicious.posnR Documentation

Find ECSAS watches with suspicious positions

Description

Find watches where the difference in distance traveled as calculated by lat/long vs dead reckoning seems suspicious, or where unreasonable speeds would be necessary.

Usage

ECSAS.find.suspicious.posn(
  dat = NULL,
  diff.thresh.pct = 50,
  speed.thresh = 20,
  leave = NULL,
  debug = FALSE
)

Arguments

dat

a dataframe, such as returned by ECSAS.extract(), containing, at a minimum, fields named LatStart, LatEnd, LongStart, LongEnd, PlatformSpeed, CalcDurMin.

diff.thresh.pct

(numeric, as percentage, default 50) maximum percentage of the smaller of the two distances that the difference is allowed to be before being flagged as problematic.

speed.thresh

(numeric, in knots, default 20) the function will return watches where the speed required to achieve the distance traveled (given by start and end coordinates) would be greater than speed.thresh.

leave

(numeric, debualt NULL) vector of WatchID's to ignore problems with. Typically these will have been vetted by hand.

Details

This function uses two heuristics to find watches with suspicious position and/or speed and time information.

Firstly, it looks for watches whose length in km as calculated by dead-reckoning (speed * time) is significantly different than that calculated by geosphere::distGeo() using start and end positions. A watch is flagged as significantly different if the difference between the two distance measures is >= diff.thresh.pct percent of the smaller of the two distances.

Secondly, for watches with both start and end positions, it looks for watches that would require an unreasonable speed (greater than speed.thresh) to achieve that distance during the watch (given by dat$CalcDurMin).

Value

Returns dat with the following additional columns added:

dist_geo_km distance as calculated by geosphere::distGeo()
dist_dr_km distance as calculated by dead reckoning: PlatformSpeed * (CalcDurMin / 60) * 1.852. Note the conversion from nautical miles to km.
dist_diff_km difference in the two distances
dist_pct_diff percentage difference (of the smaller distance)
reqd_speed the speed (in knots) that would be required to move from the start location to the end location during CalcDurMin

Author

Dave Fifield

Note

Only returns one row per watch even if there are multiple observations per watch.

See Also

ECSAS.extract()


RoyChristian/ECSASconnect documentation built on June 10, 2025, 6:02 a.m.