View source: R/geopressuretemplate.R
geopressuretemplate | R Documentation |
The geopressuretemplate()
function manages the complete workflow for modelling bird
trajectories using geolocator data. It includes the creation tag
object, the construction of
the likelihood maps (pressure and/or light), the creation of the graph model construction, and,
finally, the estimation of the trajectory products and the pressure path computation. Read the
Workflow chapter in the GeoPressureManual for more
information.
To be able to run successfully these function, you will need to have correctly set-up the data and configuration files according following the GeoPressureTemplate standard .
geopressuretemplate(
id,
config = config::get(config = id),
quiet = FALSE,
file = glue::glue("./data/interim/{id}.RData"),
...
)
geopressuretemplate_config(
id,
config = config::get(config = id),
assert_graph = FALSE,
...
)
geopressuretemplate_graph(
id,
config = config::get(config = id),
quiet = FALSE,
file = glue::glue("./data/interim/{id}.RData"),
...
)
geopressuretemplate_pressurepath(
id,
config = config::get(config = id),
quiet = FALSE,
file = glue::glue("./data/interim/{id}.RData"),
...
)
geopressuretemplate_tag(
id,
config = config::get(config = id),
quiet = FALSE,
file = glue::glue("./data/interim/{id}.RData"),
assert_graph = FALSE,
...
)
id |
unique identifier of a tag. |
config |
configuration object specifying workflow parameters, which is loaded by default
using |
quiet |
Logical. If |
file |
A file path to save the intermediate results (e.g., tag, graph, and pressure paths).
Default is |
... |
Additional parameters to overwrite default or config values. Always prefer to modify
|
assert_graph |
Logical. If |
The geopressuretemplate
function is a high-level entry point that coordinates multiple
steps for processing the geolocator data and produce trajectories. It relies on underlying child
functions for each step:
Tag Creation geopressuretemplate_tag()
: Initializes and labels the tag
object. It
also generates light and pressure likelihood maps:
tag_create()
: Initializes the tag object.
tag_label()
: Adds labels.
tag_set_map()
: Sets the spatial and temporal parameters.
If "map_pressure"
is in the config$geopressuretemplate$likelihood
:
geopressure_map()
: Computes the pressure likelihood.
If "map_light"
is in the config$geopressuretemplate$likelihood
:
twilight_create() |> twilight_read() |> geolight_map()
: Computes the light likelihood.
Graph Creation geopressuretemplate_graph()
: Builds a movement model graph
based tag
data, and can include wind effects if specified. Outputs such as
marginal distributions, most likely paths, and simulation paths can be computed.
graph_create()
: Creates the graph based on tag.
If config$graph_set_movement$type == "gs"
(i.e., no wind):
graph_set_movement()
: Sets the movement model without wind.
If config$graph_set_movement$type == "as"
(i.e., with wind):
graph_add_wind()
: Adds wind data to the graph.
graph_set_movement()
: Sets the movement model with wind.
If "marginal"
is in config$geopressuretemplate$outputs
:
graph_marginal()
: Computes the marginal distribution map.
If "most_likely"
is in config$geopressuretemplate$outputs
:
graph_most_likely()
: Computes the most likely path based on the movement model.
If "simulation"
is in config$geopressuretemplate$outputs
:
graph_simulation()
: Runs simulations to model multiple possible paths.
save()
: Saves the computed graph and associated objects in data/interim/{id}.Rdata
Pressure Path Processing geopressuretemplate_pressurepath()
: Computes pressurepaths
(pressurepath_create
) using the content of the Rdata
file and appending the pressurepath
data.frame to the same file.
If "most_likely"
is in config$geopressuretemplate$pressurepath
, computes the pressure path
for path_most_likely
.
If "geopressureviz"
is in config$geopressuretemplate$pressurepath
computes the pressure
path for path_geopressureviz
Each of these child functions can be called individually or automatically as part of
the geopressuretemplate
workflow.
The function returns nothing. Instead, it saves the processed outputs (tag, graph,
pressure paths, etc.) to the specified file
.
## Not run:
# Run the complete geopressuretemplate workflow
geopressuretemplate("18LX")
# Or run step-by-step
# you can check that all the parameters are correctly set in the config file
geopressuretemplate_config(id)
# 1. creation of the tag
tag <- geopressuretemplate_tag("18LX")
# 2. creation of the graph
geopressuretemplate_graph("18LX")
# 3. Computation of the pressurepath
geopressuretemplate_pressurepath("18LX")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.