id <- "18LX"
library(GeoPressureR)
13 Workflow
The GeoPressureR workflow follows a series of functions taking as input the raw data, the labels, and the configuration, to produce trajectory outputs.
Extract of the GeoPressureR cheatsheet illustrating the workflow
13.1 Presentation of geopressuretemplate()
After performing all preparations steps, you will be able to run the entire workflow in a single line:
geopressuretemplate("18LX")
The geopressuretemplate()
function calls on three child functions outlined below. data/interim/{id}.Rdata
is created in Step 1, and then updated in steps 2 and 3 with the main variables (see below).
-
tag_create()
: Initializes the tag object. -
tag_label()
: Adds labels. -
tag_set_map()
: Sets the spatial and temporal parameters. - *
geopressure_map()
Computes the pressure likelihood. - *
twilight_create()
|>
twilight_read()
|>
geolight_map()
: Computes the light likelihood.
-
graph_create()
: Creates the graph based on tag. - *
graph_add_wind()
: Adds wind data to the graph. -
graph_set_movement()
: Sets the movement model - *
graph_marginal()
: Computes the marginal distribution map. - *
graph_most_likely()
: Computes the most likely path based on the movement model. - *
graph_simulation()
: Runs simulations to model multiple possible paths.
3.geopressuretemplate_pressurepath()
Compute pressurepath pressurepath_create()
of the path_most_likely
and/or the path_geopressureviz
.
13.2 Configuration the workflow
All parameters of the workflow’s function are provided in the config.yml
file following the structure:
tag_id:
function_name:
argument: value
On top of all GeoPressureR function, you will also need to provide general workflow parameters in geopressuretemplate
:
default:
geopressuretemplate:
likelihood: ["map_pressure", "map_light"]
outputs: ["marginal", "most_likely", "simulation"]
pressurepath: ["most_likely"]
likelihood
define which likelihood map to compute and use in the graph model while outputs
define which outputs to use. In pressurepath
, you need to set which path to use.
You can check the configuration used with:
This is constructed by combining the default parameters used in GeoPressureR overwritten by the parameters you’ve written in config.yml
in the config default
and overwritten by the config 18LX
.
13.3 Tag
The tag workflow simply consists of preparing the tag data and computing the likelihood map.
tag <- geopressuretemplate_tag(id)
With saveit = TRUE
, this will create data/interim/18LX.Rdata
which can later be used for your own analysis.
13.4 Graph
The graph workflow uses the tag
computed before to create the graph and produce the outputs according to what you defined in geopressuretemplate
in config.yml
graph <- geopressuretemplate_graph(id)
Because the construction of the graph can be a bit more complicated and takes a lot of time, we’ve implemented a tryCatch
approach which returns the graph
in case the code fails during the processing so that you can troubleshoot the problem more easily.
13.5 Pressurepath
geopressuretemplate_pressurepath(id, quiet = FALSE)
13.6 Outputs
All the information needed for your analysis should now be contained in ./data/interim/18LX.RData