Skip to contents

Retrieve the edges in a graph corresponding to the flight transition defined by a path. These edges can be useful to extract flight information specific to a path.

Usage

path2edge(path, tag_graph)

Arguments

path

a GeoPressureR path data.frame

tag_graph

either a tag or a graph GeoPressureR object.

Value

Data.frame of the edge containing:

  • j: index of the path (1 if path has no j column).

  • s: index in 3D (lat-lon-stap) of the origin (source).

  • t: index in 3D (lat-lon-stap) of the destination (target).

  • lat_s: latitude of the origin (source).

  • lat_t: latitude of the destination (target).

  • lon_s: longitude of the origin (source).

  • lon_t: longitude of the destination (target).

  • stap_s: stationary period of the origin (source).

  • stap_t: stationary period of the destination (target).

  • distance: Distance (in km) of the flight.

  • start: start of the flight.

  • end: end of the flight.

  • duration: duration of the flight.

  • n: number of flights.

  • bearing: Angle of the flight in degree (0° = North, 90° = East).

  • gs: groundspeed vector expressed as a complex number. You can compute the groundspeed value (km/h) with abs(gs), the W-E and S-N component of the flight with Re(gs) and Im(gs), and the angle/direction with Arg(gs). If graph provided.

  • ws: windspeed vector (km/h) expressed as a complex number, in the same format as gs. Only if graph provided and computed with graph_add_wind(). Airspeed is computed with as = gs - ws in complex number to keep the vectorial additive properties.

Examples

withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
  tag <- load_interim("18LX", var = "tag")
  path <- load_interim("18LX", var = "path_most_likely")
})

edge <- path2edge(path, tag)
head(edge)
#>   stap_s stap_t j     s     t lat_s lat_t lon_s lon_t               start
#> 1      1      2 1  6603 14306 48.90 47.25 17.05 16.75 2017-08-04 19:47:30
#> 2      2      3 1 14306 21712 47.25 44.25 16.75 14.75 2017-08-05 19:27:30
#> 3      3      4 1 21712 29718 44.25 41.25 14.75 15.75 2017-08-06 19:12:30
#> 4      4      5 1 29718 36918 41.25 41.25 15.75 12.75 2017-08-07 19:12:30
#>                   end duration n distance  bearing                     gs
#> 1 2017-08-04 23:17:30 3.500000 1 185.0271 187.0384  -6.477772-52.4665160i
#> 2 2017-08-06 02:52:30 7.416667 1 368.2925 205.6689 -21.510066-44.7568493i
#> 3 2017-08-07 03:12:30 8.000000 1 343.8094 165.9045  10.466340-41.6822161i
#> 4 2017-08-08 00:12:30 5.000000 1 251.0708 270.9891 -50.206678+ 0.8668473i