How to access sample trajectories?๏
A bundle of sample trajectories covering various situations has been included in the library for reference, testing and for providing a baseline to compare the performance of various methods and algorithms.
All sample trajectories are available in the traffic.data.samples module. The
import automatically dispatch to Flight
or
Traffic
according to the nature of the data.
Note
A subset of the sample trajectories are presented on this page. Other parts of the documentation (e.g. calibration flights or trajectory clustering) may refer to other available sample trajectories.
Belevingsvlucht๏
https://www.belevingsvlucht.nl/
On May 30th 2018, test flights were conducted along future routes arriving and departing from Lelystad Airport in the Netherlands. The purpose of this flight operated by a Boeing 737 owned by Transavia was to assess noise exposure in neighbouring cities.
from traffic.data.samples import belevingsvlucht
belevingsvlucht
Flight
- callsign: TRA051
- aircraft:
484506
ยท ๐ณ๐ฑ PH-HZO (B738) - start: 2018-05-30 15:21:38+00:00
- stop: 2018-05-30 20:22:56+00:00
- duration: 0 days 05:01:18
- sampling rate: 1 second(s)
Dreamliner Air France๏
After getting their first Boeing 787 Dreamliner, Air France equipped a Socata TBM 900 and shot the following video in 8k. Both trajectories are (partly) available as sample flights.
You can explore how the two trajectories intertwine for shooting purposes:
from traffic.data.samples import dreamliner_airfrance
dreamliner_airfrance
Traffic
with 2 identifierscount | ||
---|---|---|
icao24 | callsign | |
39c424 | AFR787V | 13143 |
3900fb | FWKDL | 4767 |
dreamliner_airfrance['AFR787V'] | dreamliner_airfrance['FWKDL']
Flight
- callsign: AFR787V
- aircraft:
39c424
ยท ๐ซ๐ท F-HRBE (B789) - start: 2017-12-01 12:47:57+00:00
- stop: 2017-12-01 16:26:59+00:00
- duration: 0 days 03:39:02
- sampling rate: 1 second(s)
Flight
- callsign: FWKDL
- aircraft:
3900fb
ยท ๐ซ๐ท F-WKDL (TBM7) - start: 2017-12-01 14:40:33+00:00
- stop: 2017-12-01 15:59:59+00:00
- duration: 0 days 01:19:26
- sampling rate: 1 second(s)
dreamliner_airfrance.map_leaflet(
highlight=dict(red=lambda f: f.query('icao24 == "3900fb"')),
center=(43.5, 3.37),
zoom=9,
)
The following Altair specification lets you plot the altitude profile (clamped to 20,000 ft) for the two trajectories. The steps in the altitude profile are due to the low sampling rate in the data:
import altair as alt
chart = (
alt.layer(
*list(
flight.chart().encode(
alt.X("utchoursminutes(timestamp)", title=""),
alt.Y(
"altitude",
title="",
scale=alt.Scale(domain=(5000, 20000), clamp=True),
),
alt.Color("callsign", title="Callsign of the aircraft"),
)
for flight in dreamliner_airfrance.between(
"2017-12-01 14:40", "2017-12-01 15:40"
)
)
)
.properties(title="Altitude (in ft)", width=600)
.configure_title(anchor="start", font="Lato", fontSize=15, dy=-5)
.configure_axis(labelFontSize=12)
.configure_legend(orient="bottom", titleFont="Lato", titleFontSize=13)
)
chart
Airbus tree๏
Before Christmas 2017, an Airbus pilot in Germany has delivered an early festive present by tracing the outline of an enormous Christmas tree during a test flight.
from traffic.data.samples import airbus_tree
airbus_tree
Flight
- callsign: AIB232E
- aircraft:
3807fa
- start: 2017-12-13 11:47:15+00:00
- stop: 2017-12-13 17:08:40+00:00
- duration: 0 days 05:21:25
- sampling rate: 4 second(s)
Other trajectories๏
Even though all trajectories are accessible from the traffic.data.samples
module, they are in practice organised by categories:
from pkgutil import iter_modules # one of Python inspection modules
from traffic.data import samples
list(category.name for category in iter_modules(samples.__path__))
['ambulances',
'calibration',
'collections',
'featured',
'firefighting',
'fr24',
'gliders',
'military',
'noisy',
'onground',
'performance',
'surveillance',
'surveys',
'tv_relay']
For instance, National Geographic Institutes sometimes conduct aerial surveys
including photography and LIDAR measurements from aircraft, some of such
trajectories are available in the surveys
module (category).
In each category, you can list all available trajectories:
from traffic.data.samples import surveys
surveys.__all__
['georeal_fyn_island',
'ign_fontainebleau',
'ign_lot_et_garonne',
'ign_mercantour',
'indiana',
'liguria',
'mecsek_mountains',
'pixair_toulouse',
'texas']
Then the same trajectory is available both from the module of each category (here surveys
) and
from the root samples
module:
surveys.pixair_toulouse | samples.pixair_toulouse
Flight
- callsign: PXR31F
- aircraft:
39b861
ยท ๐ซ๐ท F-HODB (PA31) - start: 2019-03-31 08:52:04+00:00
- stop: 2019-03-31 13:32:34+00:00
- duration: 0 days 04:40:30
- sampling rate: -9 second(s)
Flight
- callsign: PXR31F
- aircraft:
39b861
ยท ๐ซ๐ท F-HODB (PA31) - start: 2019-03-31 08:52:04+00:00
- stop: 2019-03-31 13:32:34+00:00
- duration: 0 days 04:40:30
- sampling rate: -9 second(s)
So in practice, both imports are valid (and completion helps in both cases):
from traffic.data.samples import pixair_toulouse
from traffic.data.samples.surveys import pixair_toulouse
You can make a Traffic object from a category module:
from traffic.core import Traffic
t_surveys = Traffic.from_flights( # actually, this is equivalent to sum(...)
getattr(surveys, name) # getattr(surveys, "pixair_toulouse") is surveys.pixair_toulouse
.assign(flight_id=name) # gives a flight_id to each trajectory
for name in surveys.__all__
)
t_surveys
Traffic
with 9 identifierscount | |
---|---|
flight_id | |
ign_fontainebleau | 1930 |
pixair_toulouse | 1819 |
liguria | 1516 |
mecsek_mountains | 1462 |
georeal_fyn_island | 1254 |
ign_lot_et_garonne | 814 |
indiana | 755 |
texas | 703 |
ign_mercantour | 630 |
As illustrated throughout this documentation, the |
operator (or_
)
concatenates Jupyter representations of eligible objects. Therefore, the
following trick lets you apply the or_
operator to all flights available in
the surveys
category:
from functools import reduce
from operator import or_
# this will do surveys.flight1 | surveys.flight2 | surveys.flight3 | etc.
reduce(or_, t_surveys)
Flight georeal_fyn_island
- callsign: OKVOK
- aircraft:
49d1d3
ยท ๐จ๐ฟ OK-VOK (C421) - start: 2018-04-19 07:31:00+00:00
- stop: 2018-04-19 10:59:50+00:00
- duration: 0 days 03:28:50
- sampling rate: 10 second(s)
Flight ign_fontainebleau
- callsign: FGALN
- aircraft:
39016d
ยท ๐ซ๐ท F-GALN (BE20) - start: 2019-02-27 08:51:13+00:00
- stop: 2019-02-27 16:04:21+00:00
- duration: 0 days 07:13:08
- sampling rate: 13 second(s)
Flight ign_lot_et_garonne
- callsign: FGALN
- aircraft:
39016d
ยท ๐ซ๐ท F-GALN (BE20) - start: 2017-06-10 07:04:10+00:00
- stop: 2017-06-10 12:09:48+00:00
- duration: 0 days 05:05:38
- sampling rate: 23 second(s)
Flight ign_mercantour
- callsign: FGALN
- aircraft:
39016d
ยท ๐ซ๐ท F-GALN (BE20) - start: 2017-07-06 06:53:36+00:00
- stop: 2017-07-06 10:28:31+00:00
- duration: 0 days 03:34:55
- sampling rate: 21 second(s)
Flight indiana
- callsign: N441FS
- aircraft:
a54ee2
ยท ๐บ๐ธ N441FS (C441) - start: 2018-07-08 13:03:44+00:00
- stop: 2018-07-08 18:12:26+00:00
- duration: 0 days 05:08:42
- sampling rate: 25 second(s)
Flight liguria
- callsign: IGRAD
- aircraft:
3006bd
ยท ๐ฎ๐น I-GRAD (P68) - start: 2020-04-15 07:39:00+00:00
- stop: 2020-04-15 11:51:30+00:00
- duration: 0 days 04:12:30
- sampling rate: 10 second(s)
Flight mecsek_mountains
- callsign: HAYCG
- aircraft:
473f9a
ยท ๐ญ๐บ HA-YCG (PA27) - start: 2020-03-17 11:40:10+00:00
- stop: 2020-03-17 15:43:40+00:00
- duration: 0 days 04:03:30
- sampling rate: 10 second(s)
Flight pixair_toulouse
- callsign: PXR31F
- aircraft:
39b861
ยท ๐ซ๐ท F-HODB (PA31) - start: 2019-03-31 08:52:04+00:00
- stop: 2019-03-31 13:32:34+00:00
- duration: 0 days 04:40:30
- sampling rate: -9 second(s)
Flight texas
- callsign: N441FS
- aircraft:
a54ee2
ยท ๐บ๐ธ N441FS (C441) - start: 2018-10-27 14:38:40+00:00
- stop: 2018-10-27 19:13:55+00:00
- duration: 0 days 04:35:15
- sampling rate: 24 second(s)