tag2path | R Documentation |
path
from the likelihood maps of a tag
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.
tag2path(tag, likelihood = NULL, interp = FALSE, use_known = TRUE)
tag |
a GeoPressureR |
likelihood |
Field of the |
interp |
the position of the stationary period shorter than |
use_known |
If true, enforce the known position in the path created. The known positions are approximated to the map resolution in order to corresponds to integer index. |
A path data.frame
stap_id
stationary period
ind
indices of the coordinate in the 2D grid. Useful to retrieve map or graph information.
lat
Latitude,
lon
longitude
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- tag_create("18LX", quiet = TRUE) |>
tag_label(quiet = TRUE) |>
tag_set_map(
extent = c(-16, 23, 0, 50),
scale = 2
) |>
geopressure_map(quiet = TRUE)
})
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.