openSkies

Rafael Ayala, Daniel Ayala, Aleix Sellés, Lara Sellés Vidal

October 14, 2020


Introduction

OpenSky (https://opensky-network.org/) provides free access to different types of flight and aircraft information. Flight information includes lists of aicrafts that landed at or departed from a specific airport and flights registered during a certain time interval. It is also possible to retrieve status informations received from aircraft transponders, including positional information, origin and destination.

openSkies provides an R interface to the OpenSky REST API, which aims to automate and facilitate the retrieval and utilization of the information provided by OpenSky.

Installation instructions

Before installing openSkies, make sure you have the latest version of R installed. To install openSkies, start R and enter:

install.packages("openSkies")

Once installed, the package can be loaded as shown below:

library(openSkies)

Accessing flight information

Information regarding flights can be accessed in four ways: by airport of arrival, by airport of departure, by aircraft and by time interval. For the first two access modes, it is necessary to provide the ICAO code of the airport. This can be obtained in websites such as https://www.world-airport-codes.com/. Some examples are “EDDF” for Frankfurt International Airport (Germany), or “LEBL” for Barcelona Airport (Spain).

For retrieval of flights by aicraft, it is necessary to provide the ICAO 24-bit address of the aircraft. This can be obtained from multiple sources, such as http://www.airframes.org/. For example, 346190 corresponds to an ATR 72-600 of Air Nostrum with registration EC-NCD.

The function getAirportArrivals() lists all flights that arrived at a given airport.

# Get all flights that arrived at Frankfurt International Airport on the 29th of
# January, 2018 between 12 PM and 1 PM, local time.

getAirportArrivals(airport = "EDDF", startTime = "2018-01-29 12:00:00", endTime = "2018-01-29 13:00:00", 
    timeZone = "Europe/Berlin")
## [[1]]
## Flight performed by aircraft with ICAO 24-bit address e48ba9
## Take-off time: 2018-01-29 01:37:37 Europe/Madrid
## Landing time:  2018-01-29 12:59:26 Europe/Madrid
## [[2]]
## Flight performed by aircraft with ICAO 24-bit address 3c65ca
## Take-off time: 2018-01-29 11:58:03 Europe/Madrid
## Landing time:  2018-01-29 12:59:20 Europe/Madrid
## [[3]]
## Flight performed by aircraft with ICAO 24-bit address 3c664e
## Take-off time: 2018-01-29 12:09:37 Europe/Madrid
## Landing time:  2018-01-29 12:56:22 Europe/Madrid
## [[4]]
## Flight performed by aircraft with ICAO 24-bit address 3c661a
## Take-off time: 2018-01-29 11:50:44 Europe/Madrid
## Landing time:  2018-01-29 12:52:45 Europe/Madrid
## [[5]]
## Flight performed by aircraft with ICAO 24-bit address 896199
## Take-off time: 2018-01-29 10:08:30 Europe/Madrid
## Landing time:  2018-01-29 12:51:37 Europe/Madrid
## [[6]]
## Flight performed by aircraft with ICAO 24-bit address 3c6495
## Take-off time: 2018-01-29 12:05:34 Europe/Madrid
## Landing time:  2018-01-29 12:49:27 Europe/Madrid
## [[7]]
## Flight performed by aircraft with ICAO 24-bit address 89629c
## Take-off time: 2018-01-29 10:04:37 Europe/Madrid
## Landing time:  2018-01-29 12:46:48 Europe/Madrid
## [[8]]
## Flight performed by aircraft with ICAO 24-bit address 4951d0
## Take-off time: 2018-01-29 10:01:07 Europe/Madrid
## Landing time:  2018-01-29 12:45:22 Europe/Madrid
## [[9]]
## Flight performed by aircraft with ICAO 24-bit address 3c666c
## Take-off time: 2018-01-29 10:55:09 Europe/Madrid
## Landing time:  2018-01-29 12:43:53 Europe/Madrid
## [[10]]
## Flight performed by aircraft with ICAO 24-bit address 508390
## Take-off time: 2018-01-29 10:27:04 Europe/Madrid
## Landing time:  2018-01-29 12:42:26 Europe/Madrid
## [[11]]
## Flight performed by aircraft with ICAO 24-bit address 7804c6
## Take-off time: 2018-01-29 11:43:10 Europe/Madrid
## Landing time:  2018-01-29 12:41:28 Europe/Madrid
## [[12]]
## Flight performed by aircraft with ICAO 24-bit address 3c6634
## Take-off time: 2018-01-29 11:30:14 Europe/Madrid
## Landing time:  2018-01-29 12:29:59 Europe/Madrid
## [[13]]
## Flight performed by aircraft with ICAO 24-bit address 3c65c3
## Take-off time: 2018-01-29 11:10:33 Europe/Madrid
## Landing time:  2018-01-29 12:29:27 Europe/Madrid
## [[14]]
## Flight performed by aircraft with ICAO 24-bit address 3c6676
## Take-off time: 2018-01-29 11:27:03 Europe/Madrid
## Landing time:  2018-01-29 12:26:25 Europe/Madrid
## [[15]]
## Flight performed by aircraft with ICAO 24-bit address 451d85
## Take-off time: 2018-01-29 10:19:02 Europe/Madrid
## Landing time:  2018-01-29 12:24:26 Europe/Madrid
## [[16]]
## Flight performed by aircraft with ICAO 24-bit address 3c66a9
## Take-off time: 2018-01-29 10:56:20 Europe/Madrid
## Landing time:  2018-01-29 12:22:43 Europe/Madrid
## [[17]]
## Flight performed by aircraft with ICAO 24-bit address 3c66aa
## Take-off time: 2018-01-29 11:24:41 Europe/Madrid
## Landing time:  2018-01-29 12:21:43 Europe/Madrid
## [[18]]
## Flight performed by aircraft with ICAO 24-bit address 3c6655
## Take-off time: 2018-01-29 11:30:00 Europe/Madrid
## Landing time:  2018-01-29 12:21:18 Europe/Madrid
## [[19]]
## Flight performed by aircraft with ICAO 24-bit address 4baa03
## Take-off time: 2018-01-29 09:34:04 Europe/Madrid
## Landing time:  2018-01-29 12:19:57 Europe/Madrid
## [[20]]
## Flight performed by aircraft with ICAO 24-bit address 3c667a
## Take-off time: 2018-01-29 11:29:33 Europe/Madrid
## Landing time:  2018-01-29 12:19:18 Europe/Madrid
## [[21]]
## Flight performed by aircraft with ICAO 24-bit address 3c5463
## Take-off time: 2018-01-29 11:13:10 Europe/Madrid
## Landing time:  2018-01-29 12:17:59 Europe/Madrid
## [[22]]
## Flight performed by aircraft with ICAO 24-bit address 3c6626
## Take-off time: 2018-01-29 11:33:30 Europe/Madrid
## Landing time:  2018-01-29 12:15:16 Europe/Madrid
## [[23]]
## Flight performed by aircraft with ICAO 24-bit address 3c6598
## Take-off time: 2018-01-29 11:37:30 Europe/Madrid
## Landing time:  2018-01-29 12:15:13 Europe/Madrid
## [[24]]
## Flight performed by aircraft with ICAO 24-bit address 4ca78d
## Take-off time: 2018-01-29 10:19:42 Europe/Madrid
## Landing time:  2018-01-29 12:14:06 Europe/Madrid
## [[25]]
## Flight performed by aircraft with ICAO 24-bit address 06a052
## Take-off time: 2018-01-28 23:10:57 Europe/Madrid
## Landing time:  2018-01-29 12:13:58 Europe/Madrid
## [[26]]
## Flight performed by aircraft with ICAO 24-bit address 3c5469
## Take-off time: 2018-01-29 11:14:02 Europe/Madrid
## Landing time:  2018-01-29 12:12:27 Europe/Madrid
## [[27]]
## Flight performed by aircraft with ICAO 24-bit address 3c66ac
## Take-off time: 2018-01-29 10:24:33 Europe/Madrid
## Landing time:  2018-01-29 12:11:24 Europe/Madrid
## [[28]]
## Flight performed by aircraft with ICAO 24-bit address 3c658b
## Take-off time: 2018-01-29 11:08:31 Europe/Madrid
## Landing time:  2018-01-29 12:10:46 Europe/Madrid
## [[29]]
## Flight performed by aircraft with ICAO 24-bit address 400152
## Take-off time: 2018-01-29 08:31:30 Europe/Madrid
## Landing time:  2018-01-29 12:09:52 Europe/Madrid
## [[30]]
## Flight performed by aircraft with ICAO 24-bit address 3c66ae
## Take-off time: 2018-01-29 11:18:00 Europe/Madrid
## Landing time:  2018-01-29 12:08:59 Europe/Madrid
## [[31]]
## Flight performed by aircraft with ICAO 24-bit address 3c644a
## Take-off time: 2018-01-29 11:12:32 Europe/Madrid
## Landing time:  2018-01-29 12:08:05 Europe/Madrid
## [[32]]
## Flight performed by aircraft with ICAO 24-bit address 3c66a2
## Take-off time: 2018-01-29 11:25:25 Europe/Madrid
## Landing time:  2018-01-29 12:07:22 Europe/Madrid
## [[33]]
## Flight performed by aircraft with ICAO 24-bit address 3c4aa6
## Take-off time: 2018-01-28 12:47:21 Europe/Madrid
## Landing time:  2018-01-29 12:03:55 Europe/Madrid
## [[34]]
## Flight performed by aircraft with ICAO 24-bit address 3c6667
## Take-off time: 2018-01-29 10:54:41 Europe/Madrid
## Landing time:  2018-01-29 12:03:42 Europe/Madrid
## [[35]]
## Flight performed by aircraft with ICAO 24-bit address 3c6621
## Take-off time: 2018-01-29 11:32:21 Europe/Madrid
## Landing time:  2018-01-29 12:01:58 Europe/Madrid

The function getAirportDepartures() lists all flights that arrived at a given airport.

# Get all flights that departed from Barcelona Airport on the 12th of October,
# 2020 between 5 AM and 7 AM, local time.

getAirportDepartures(airport = "LEBL", startTime = "2020-10-12 05:00:00", endTime = "2020-10-12 07:00:00", 
    timeZone = "Europe/Madrid")
## [[1]]
## Flight performed by aircraft with ICAO 24-bit address 345313
## Take-off time: 2020-10-12 06:59:24 Europe/Madrid
## Landing time:  2020-10-12 08:08:29 Europe/Madrid
## [[2]]
## Flight performed by aircraft with ICAO 24-bit address 4ca912
## Take-off time: 2020-10-12 06:49:48 Europe/Madrid
## Landing time:  2020-10-12 07:20:27 Europe/Madrid
## [[3]]
## Flight performed by aircraft with ICAO 24-bit address 4ca703
## Take-off time: 2020-10-12 06:41:08 Europe/Madrid
## Landing time:  2020-10-12 08:44:48 Europe/Madrid
## [[4]]
## Flight performed by aircraft with ICAO 24-bit address 484cb5
## Take-off time: 2020-10-12 06:29:16 Europe/Madrid
## Landing time:  2020-10-12 08:27:53 Europe/Madrid
## [[5]]
## Flight performed by aircraft with ICAO 24-bit address 3944f9
## Take-off time: 2020-10-12 06:24:03 Europe/Madrid
## Landing time:  2020-10-12 08:12:29 Europe/Madrid
## [[6]]
## Flight performed by aircraft with ICAO 24-bit address 4ca8af
## Take-off time: 2020-10-12 06:22:20 Europe/Madrid
## Landing time:  2020-10-12 08:46:41 Europe/Madrid
## [[7]]
## Flight performed by aircraft with ICAO 24-bit address 4ca2d6
## Take-off time: 2020-10-12 06:20:53 Europe/Madrid
## Landing time:  2020-10-12 08:14:47 Europe/Madrid
## [[8]]
## Flight performed by aircraft with ICAO 24-bit address 4ca4f8
## Take-off time: 2020-10-12 06:08:48 Europe/Madrid
## Landing time:  2020-10-12 09:05:39 Europe/Madrid
## [[9]]
## Flight performed by aircraft with ICAO 24-bit address 4ca4e8
## Take-off time: 2020-10-12 06:06:45 Europe/Madrid
## Landing time:  2020-10-12 07:24:17 Europe/Madrid
## [[10]]
## Flight performed by aircraft with ICAO 24-bit address a382b3
## Take-off time: 2020-10-12 05:46:22 Europe/Madrid
## Landing time:  2020-10-12 07:32:05 Europe/Madrid

The function getAircraftFlights() lists all flights performed by a given aircraft.

# Get all flights registered for the aircraft with ICAO 24-bit address 346190
# during the 26th of July, 2019.

getAircraftFlights("346190", startTime = "2019-07-26 00:00:00", endTime = "2019-07-26 23:59:59", 
    timeZone = "Europe/Madrid")
## [[1]]
## Flight performed by aircraft with ICAO 24-bit address 346190
## Take-off time: 2019-07-26 16:27:36 Europe/Madrid
## Landing time:  2019-07-26 17:52:57 Europe/Madrid
## [[2]]
## Flight performed by aircraft with ICAO 24-bit address 346190
## Take-off time: 2019-07-26 14:15:31 Europe/Madrid
## Landing time:  2019-07-26 14:54:28 Europe/Madrid
## [[3]]
## Flight performed by aircraft with ICAO 24-bit address 346190
## Take-off time: 2019-07-26 12:48:45 Europe/Madrid
## Landing time:  2019-07-26 13:27:10 Europe/Madrid
## [[4]]
## Flight performed by aircraft with ICAO 24-bit address 346190
## Take-off time: 2019-07-26 08:54:01 Europe/Madrid
## Landing time:  2019-07-26 09:30:52 Europe/Madrid
## [[5]]
## Flight performed by aircraft with ICAO 24-bit address 346190
## Take-off time: 2019-07-26 07:32:33 Europe/Madrid
## Landing time:  2019-07-26 08:09:58 Europe/Madrid

The function getIntervalFlights() lists all flights registered during a given time interval, by any aircraft. It should be noted that such type of requests will return a large number of results depending on the length of the time interval.

# Obtain a list with information for all the flights registered during the 16th
# of November, 2019 between 9 AM and 10 AM, London time.

flights <- getIntervalFlights(startTime = "2019-11-16 09:00:00", endTime = "2019-11-16 10:00:00", 
    timeZone = "Europe/London")

# Count the number of registered flights.

length(flights)
## [1] 514

Accessing aircraft state vectors

State vectors contain status information sent by the transponder of an aircraft. This includes position, altitude, country of origin, speed, and other types of data. While it is possible to perform these requests anonymously, authenticating as a registered user offers access to additional data (see manual pages for details).

It is possible to obtain a set of state vectors corresponding to information received at a specified time point, filtered by different criteria (such as aircraft or location).

# Obtain a list with the state vectors for all aircrafts currently flying over an
# area covering Switzerland.

getSingleTimeStateVectors(minLatitude = 45.8389, maxLatitude = 47.8229, minLongitude = 5.9962, 
    maxLongitude = 10.5226)
## <openSkiesStateVectorSet>
##   Public:
##     add_state_vector: function (state_vector) 
##     clone: function (deep = FALSE) 
##     get_time_points_interpolation: function (fields, time_field, timestamps, method = "fmm") 
##     get_uniform_interpolation: function (n, fields, method = "fmm") 
##     get_values: function (field, removeNAs = FALSE, unwrapAngles = FALSE) 
##     initialize: function (state_vectors_list, time_series = FALSE, segments_categories = NULL) 
##     segments_categories: NULL
##     sort_by_field: function (field, decreasing = FALSE) 
##     split_into_flights: function (timeOnLandThreshold = 300, timeDiffThreshold = 1800) 
##     state_vectors: list
##     time_series: FALSE
# Obtain the state vector for aircraft with ICAO 24-bit address 403003 for the
# 8th of October, 2020 at 16:50 London time.

getSingleTimeStateVectors(aircraft = "403003", time = "2020-10-08 16:50:00", timeZone = "Europe/London")
## State vector for aircraft with ICAO24403003
## Requested time: 2020-10-08 17:50:00 Europe/Madrid
## Last status update at: 2020-10-08 17:49:59 Europe/Madrid

It is also possible to retrieve a time series of state vectors for a specific aircraft. It should be noted that this type of requests can take a relatively long time to finish if a large amount of data points are requested.

# Obtain a time series of state vectors for the aircraft with ICAO 24-bit address
# 403003 for the 8th of October, 2020 between 16:50 and 16:53 (London time), with
# a time resolution of 1 minute.

getAircraftStateVectorsSeries("403003", startTime = "2020-10-08 16:50:00", endTime = "2020-10-08 16:52:00", 
    timeZone = "Europe/London", timeResolution = 60)
## <openSkiesStateVectorSet>
##   Public:
##     add_state_vector: function (state_vector) 
##     clone: function (deep = FALSE) 
##     get_time_points_interpolation: function (fields, time_field, timestamps, method = "fmm") 
##     get_uniform_interpolation: function (n, fields, method = "fmm") 
##     get_values: function (field, removeNAs = FALSE, unwrapAngles = FALSE) 
##     initialize: function (state_vectors_list, time_series = FALSE, segments_categories = NULL) 
##     segments_categories: NULL
##     sort_by_field: function (field, decreasing = FALSE) 
##     split_into_flights: function (timeOnLandThreshold = 300, timeDiffThreshold = 1800) 
##     state_vectors: list
##     time_series: TRUE

System of R6 classes for aviation data

openSkies also aims to establish standard data structures for the analysis of aviation data. To that extent, a set of R6 classes is defined. The classes defined so far include openSkiesAirport, openSkiesAircraft, openSkiesFlight, openSkiesRoute, openSkiesStateVector and openSkiesStateVectorSet. For a detailed description of each class and their available methods, please check the manual of the package.

References

https://opensky-network.org/

https://www.world-airport-codes.com/

http://www.airframes.org/