Reads the NetCDF files downloaded and interpolate the average windspeed experienced by the bird on each possible edge, as well as the corresponding airspeed.
In addition, the graph can be further pruned based on a threshold of airspeed thr_as
.
See section 2.2.4 in Nussbaumer (2023b) for more technical details and the GeoPressureManual for an illustration on how to use it.
Usage
graph_add_wind(
graph,
pressure,
rounding_interval = 60,
interp_spatial_linear = FALSE,
file = function(stap_id)
glue::glue("./data/wind/{graph$param$id}/{graph$param$id}_{stap_id}.nc"),
thr_as = Inf,
quiet = FALSE
)
Arguments
- graph
a GeoPressureR graph object.
- pressure
pressure measurement of the associated
tag
data used to estimate the pressure level (i.e., altitude) of the bird during the flights. This data.frame needs to containdate
as POSIXt andvalue
in hPa.- rounding_interval
temporal resolution on which to query the variable (min). Default is to match ERA5 native resolution (1hr).
- interp_spatial_linear
logical to interpolate the variable linearly over space, if
FALSE
takes the nearest neighbour. ERA5 native resolution is 0.25°- file
absolute or relative path of the ERA5 wind data file to be downloaded. Function taking as single argument the stationary period identifier.
- thr_as
threshold of airspeed (km/h).
- quiet
logical to hide messages about the progress
References
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.