xoolive / xoolive/traffic

extend aircraft dataset with ICAO Aircraft Type Designator info

Open
#176 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
513
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Introduction

traffic already provides aircraft information via either Junzi's or OpenSky's aircraft database.
I find myself needing to filter out helicopters or non land planes: given that the aircraft database has a typecode column for the ICAO aircraft type designator it would make (my?) life easier to have the possibility to join it with the Aircraft Type Designator dataset from ICAO.

Goal

Extend traffic.data.aircraft with (and/or make available on its own, say doc8643at) a dataset that contains ICAO's Aircraft Type Designator information.

ICAO web page for Doc 8643 is at https://www.icao.int/publications/DOC8643/
It provides a search facility:
https://www.icao.int/publications/DOC8643/Pages/Search.aspx

If you look behind the scenes 😁 you can see that the underlying dataset can be scraped with:

import requests
import json
import pandas as pd

doc8643_url = r = "https://www4.icao.int/doc8643/External/AircraftTypes"
r = requests.post(doc8643_url)
doc8643at = pd.json_normalize(r.json())
doc8643at.columns = doc8643at.columns.str.lower()
doc8643at = doc8643at.rename(columns={
    "modelfullname": "model",
    "manufacturercode": "manufacturer_code",
    "aircraftdescription": "aircraft_description",
    "enginecount": "engine_count",
    "enginetype": "engine_type"
    }).drop(columns=['wtg'])
model description wtc designator manufacturer_code aircraft_description engine_count engine_type
Dornier 328JET L2J M J328 328 SUPPORT SERVICES LandPlane 2 Jet
450 Ultra L1P L UL45 3XTRIM LandPlane 1 Piston
Ultra L1P L UL45 3XTRIM LandPlane 1 Piston
550 Trener L1P L TR55 3XTRIM LandPlane 1 Piston
Trener L1P L TR55 3XTRIM LandPlane 1 Piston
... ... ... ... ... ... ... ...
Z-526 Skydevil L1P L Z26 ZLIN LandPlane 1 Piston
Z-526 Trener Master L1P L Z26 ZLIN LandPlane 1 Piston
Z-626 L1P L Z26 ZLIN LandPlane 1 Piston
Z-726 Universal L1P L Z26 ZLIN LandPlane 1 Piston
Savage L1P L SAVG ZLIN AVIATION LandPlane 1 Piston

10316 rows × 9 columns

And similarly for Manufactures Codes at https://www.icao.int/publications/DOC8643/Pages/Manufacturers.aspx , say docs8643mc

Motivating Use-case

I am generally interested in analysing IFR flights, so if I could have ICAO aircraft type datasets (doc8643at and doc8643mc) joined and available in traffic.data.aircraft I would be able to apply the following filter

t_ifr = (t.aircraft_data()
            # remove GA flights:
            .query('description not in ["L1P","L2P","H1P", "H1T","H2T"]')
            # remove special designator flights
            .query('aircraft_description not in ["Gyrocopter", "Tiltrotor"])
            .query('aircraft_description not in ["Amphibian", "Helicopter"])
)

Similarly I could study piston-only flights, ... and then apply the relevant queries.

Expected behaviour

I expect traffic.data.aircraft to be augmented (joined) with doc8643at and doc8643mc.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the traffic.data.aircraft entry point and inspect how the existing Junzi and OpenSky aircraft datasets are loaded and joined. Review the ICAO Doc 8643 AircraftTypes and Manufacturers endpoints and the proposed normalized columns. Done means the ICAO datasets are available as requested and can be joined to aircraft data by typecode, with the motivating filters working.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.