Workflow for GeoPressureR
Source:R/geopressuretemplate.R
, R/geopressuretemplate_config.R
, R/geopressuretemplate_graph.R
, and 2 more
geopressuretemplate.Rd
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 .
Usage
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,
...
)
Arguments
- id
unique identifier of a tag.
- config
configuration object specifying workflow parameters, which is loaded by default using
config::get(config = id)
.- quiet
Logical. If
TRUE
, suppresses informational messages during execution. The default value isFALSE
.- file
A file path to save the intermediate results (e.g., tag, graph, and pressure paths). Default is
./data/interim/{id}.RData
.- ...
Additional parameters to overwrite default or config values. Always prefer to modify
config.yml
if possible.- assert_graph
Logical. If
TRUE
, check that the config is compatible for the creation of a graph. The default value isTRUE
. Set toFALSE
only if you don't want to create a graph model
Value
The function returns nothing. Instead, it saves the processed outputs (tag, graph,
pressure paths, etc.) to the specified file
.
Details
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 thetag
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 theconfig$geopressuretemplate$likelihood
:geopressure_map()
: Computes the pressure likelihood.
If
"map_light"
is in theconfig$geopressuretemplate$likelihood
:twilight_create() |> twilight_read() |> geolight_map()
: Computes the light likelihood.
Graph Creation
geopressuretemplate_graph()
: Builds a movement model graph basedtag
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 inconfig$geopressuretemplate$outputs
:graph_marginal()
: Computes the marginal distribution map.
If
"most_likely"
is inconfig$geopressuretemplate$outputs
:graph_most_likely()
: Computes the most likely path based on the movement model.
If
"simulation"
is inconfig$geopressuretemplate$outputs
:graph_simulation()
: Runs simulations to model multiple possible paths.
save()
: Saves the computed graph and associated objects indata/interim/{id}.Rdata
Pressure Path Processing
geopressuretemplate_pressurepath()
: Computes pressurepaths (pressurepath_create
) using the content of theRdata
file and appending the pressurepath data.frame to the same file.
If
"most_likely"
is inconfig$geopressuretemplate$pressurepath
, computes the pressure path forpath_most_likely
.If
"geopressureviz"
is inconfig$geopressuretemplate$pressurepath
computes the pressure path forpath_geopressureviz
Each of these child functions can be called individually or automatically as part of
the geopressuretemplate
workflow.
Examples
if (FALSE) { # \dontrun{
# 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")
} # }