Reads the NetCDF files and extracts the variable requested along each flight defined by the edges.
Time: linear interpolation using the resolution requested with
rounding_intervalSpace: nearest neighbour interpolation by default, or bi-linear with
pracma::interp2ifinterp_spatial_linear=TRUE. Note: spatial interpolation is limited to 0.1° for computational reasons.Pressure/altitude: linear interpolation using the exact
pressurevalues
Arguments
- graph
either a
tagor agraphGeoPressureR object.- 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
tagdata used to estimate the pressure level (i.e., altitude) of the bird during the flights. This data.frame needs to containdateas POSIXt andvaluein hPa. If not provided, usesgraph$pressure, assuming that argumentgraphis a GeoPressureRtagobject.- variable
list of the variables to extract from the ERA5 pressure level using the
shortNamenotation:"u","v","t","cc","r","w","ciwc","clwc","q","cswc","d","z","o3","pv","vo".- 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
FALSEtakes the nearest neighbour. ERA5 native resolution is 0.25°- 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 arguments (1) the stationary period identifier and (2) the tag_id.
- quiet
logical to hide messages about the progress
Value
If return_averaged_variable = TRUE, returns a data.frame with one row per edge and columns:
stap_sid of the source/origin stationary periodstap_tid of the target/destination stationary periodsnode id of the source (same as/similar toedge_s)tnode id of the target (same as/similar toedge_t)lat_slatitude of the sourcelat_tlatitude of the targetlon_slongitude of the sourcelon_tlongitude of the targetstartstart datetime of the flightendend datetime of the flightdurationflight durationnnumber of flightdistancedistance of the flightbearingbearing of the flightgsgroundspeedwswindspeed (ifgraphprovided)
If return_averaged_variable = FALSE, returns a data.frame with one row per time step and edge,
and columns:
edge_idedge indexvalvalue of the variable at each time steppressurepressure at each time stepdatedatetime of each time stepwweight for averagingvarvariable namelatlatitude at each time steplonlongitude at each time step
