View source: R/edge_add_wind.R
edge_add_wind | R Documentation |
Reads the NetCDF files and extract the variable requested along each flight defined by the edges.
Time: linear interpolation using the resolution requested with rounding_interval
Space: nearest neighbour interpolation by default or bi-linear with pracma::interp2
if
interp_spatial_linear=TRUE
Pressure/altitude: linear interpolation using the exact pressure
values
edge_add_wind(
tag_graph,
edge_s,
edge_t,
pressure = NULL,
variable = c("u", "v"),
rounding_interval = 60,
interp_spatial_linear = FALSE,
return_averaged_variable = FALSE,
file = function(stap_id)
glue::glue("./data/wind/{tag_graph$param$id}/{tag_graph$param$id}_{stap_id}.nc"),
quiet = FALSE
)
tag_graph |
either a |
edge_s |
a index of the source node of the edge. Either a vector with 3D index or a matrix of 3 columns, one for each dimension. |
edge_t |
a index of the target node of the edge. Either a vector with 3D index or a matrix of 3 columns, one for each dimension. |
pressure |
pressure measurement of the associated |
variable |
list of the variables to extract from the ERA5 pressure level using the |
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 |
return_averaged_variable |
logical to return the variable for each timestep or average for the entire flight. |
file |
absolute or relative path of the ERA5 wind data file to be downloaded. Function taking as single argument the stationary period identifier. |
quiet |
logical to hide messages about the progress |
A data.frame with columns:
stap_s
id of the source/origin stationary period
stap_t
id of the target/destination stationary period
s
node id of the source (same as/similar to edge_s
)
t
node id of the target (same as/similar to edge_t
)
lat_s
latitude of the source
lat_t
latitude of the target
lon_s
longitude of the source
lon_t
longitude of the target
start
start datetime of the flight
end
end datetime of the flight
duration
flight duration
n
number of flight
distance
distance of the flight
bearing
bearing of the flight
gs
groundspeed
ws
windspeed (if graph
provided)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.