Find the position of the highest value in a map, typically most probable value in a likelihood map.
Note that this path is the most likely, considering only the observation model and ignoring the
movement model. Prefer to use graph_most_likely() for the most realistic path accounting for
flight duration.
interp can be used to interpolate unrealistic position from short stationary periods based on
the position of the longer ones. In order to preserve a reference to the grid, the interpolation
is only performed at the centre of the grid cell (defined by the likelihood map). Note also
that it is not possible to interpolate the first and last stationary period.
Arguments
- tag
a GeoPressureR
tagobject.- likelihood
Field of the
taglist containing the likelihood map (character). By default, uses the product ofmap_pressureandmap_lightif available, otherwise the first available likelihood map in the tag.- interp
the position of the stationary period shorter than
interpwill be replaced by a linear average from other position accounting for flight duration (in days).- use_known
If
TRUE, enforce known positions fromtag$stapwhen building the path. The exactknown_latandknown_lonare used forlatandlon, whileindremains the grid cell index.
Value
A path data.frame
stap_idstationary periodjidentification of the trajectory (always1).indindices of the coordinate in the 2D grid. Useful to retrieve map or graph information.latLatitude,lonlongitude...other columns fromstapinterplogical indicating if the position was interpolated (seeinterp).
See also
Other path:
path2edge(),
path2elevation(),
path2twilight(),
plot_path()
Examples
# Load a tag with pressure and light likelihood maps computed with `geopressuretemplate()`
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- load_interim("18LX", var = "tag")
})
# Extract a path from pressure map
path <- tag2path(tag)
plot_path(path)
# Short stationary periods (e.g. 1 day) can be unreliably
# estimated, so interpolating them is often better
path <- tag2path(tag, interp = 1)
plot_path(path)
