graph_create | R Documentation |
graph
objectThis function returns a trellis graph representing the trajectory of a bird based on filtering and pruning the likelihood maps provided.
In the final graph, we only keep the likely nodes (i.e., position of the bird at each
stationary periods) defined as (1) those whose likelihood value are within the threshold of
percentile thr_likelihood
of the total likelihood map and (2) those which are connected to
at least one edge of the previous and next stationary periods requiring an average ground speed
lower than thr_gs
(in km/h).
For more details and illustration, see section 2.2 of Nussbaumer et al. (2023b) and the GeoPressureManual
graph_create(
tag,
thr_likelihood = 0.99,
thr_gs = 150,
likelihood = NULL,
geosphere_dist = geosphere::distHaversine,
geosphere_bearing = geosphere::bearing,
workers = 1,
quiet = FALSE
)
tag |
a GeoPressureR |
thr_likelihood |
threshold of percentile (see details). |
thr_gs |
threshold of groundspeed (km/h) (see details). |
likelihood |
Field of the |
geosphere_dist |
function to compute the distance. Usually, either
|
geosphere_bearing |
function to compute the bearing. Either |
workers |
number of workers used in the computation of edges ground speed. More workers
(up to the limit |
quiet |
logical to hide messages about the progress. |
Graph as a list
s
: source node (index in the 3d grid lat-lon-stap)
t
: target node (index in the 3d grid lat-lon-stap)
gs
: average ground speed required to make that transition (km/h) as complex number
representing the E-W as real and S-N as imaginary
obs
: observation model, corresponding to the normalized likelihood in a 3D matrix of size
sz
sz
: size of the 3d grid lat-lon-stap
stap
: data.frame of all stationary periods (same as tag$stap
)
equipment
: node(s) of the first stap (index in the 3d grid lat-lon-stap)
retrieval
: node(s) of the last stap (index in the 3d grid lat-lon-stap)
mask_water
: logical matrix of water-land
param
: list of parameters including thr_likelihood
and thr_gs
(same as tag$param
)
Nussbaumer, Raphaël, Mathieu Gravey, Martins Briedis, Felix Liechti, and Daniel Sheldon. 2023. Reconstructing bird trajectories from pressure and wind data using a highly optimized hidden Markov model. Methods in Ecology and Evolution, 14, 1118–1129 https://doi.org/10.1111/2041-210X.14082.
Other graph:
graph_marginal()
,
graph_most_likely()
,
graph_set_movement()
,
graph_simulation()
,
print.graph()
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- tag_create("18LX", quiet = TRUE) |>
tag_label(quiet = TRUE) |>
twilight_create() |>
twilight_label_read() |>
tag_set_map(
extent = c(-16, 23, 0, 50),
known = data.frame(stap_id = 1, known_lon = 17.05, known_lat = 48.9)
) |>
geopressure_map(quiet = TRUE) |>
geolight_map(quiet = TRUE)
})
# Create graph
graph <- graph_create(tag, thr_likelihood = 0.95, thr_gs = 100, quiet = TRUE)
print(graph)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.