Parse a flight plan#

The pycontrails.core.flightplan module provides utilities for working with standard flight plan formats.

Only ICAO ATC flight plan supported currently.

References#

[1]:
from pycontrails.core import flightplan
[2]:
atc_plan = """
(FPL-GEC8145-IN -B77L/H-SDE2E3FGHIJ3J4J5M1RWXYZ/SB1D1
-EGGL1040 -N0474F360 IMVUR1Z IMVUR N63 SAM N19 ADKIK DCT
MOPAT DCT  LIMRI/M083F360 DCT 51N020W 47N030W/M083F380 40N040W
34N045W  28N050W/M083F400 24N055W 19N060W DCT AMTTO DCT ANU DCT
-PBN/A1B1C1D1L1O1S1S2 NAV/RNVD1E2A1 DAT/SVM DOF/140501 REG/DALFA
EET/OKAC0037 ORBB0052 LTAA0159 UKFV0308 UKOV0333 LUUU0344 UKLV0406
EPWW0427 ESAA0521 EKDK0540 ENOR0557 SEL/DFBH OPR/GEC RVR/200)
-E/0740 P/3 R/E S/ J/ A/WHITE BLUE TAIL
"""
[3]:
# parse flight plan into a dictionary
plan_dict = flightplan.parse_atc_plan(atc_plan)
plan_dict
[3]:
{'callsign': 'GEC8145',
 'flight_rules': 'I',
 'type_of_flight': 'N',
 'type_of_aircraft': 'B77L',
 'wake_category': 'H',
 'equipment': 'SDE2E3FGHIJ3J4J5M1RWXYZ',
 'transponder': 'SB1D1',
 'departure_icao': 'EGGL',
 'time': '1040',
 'speed_type': 'N',
 'speed': '0474',
 'level_type': 'F',
 'level': '360',
 'route': 'IMVUR1Z IMVUR N63 SAM N19 ADKIK DCT MOPAT DCT  LIMRI/M083F360 DCT 51N020W 47N030W/M083F380 40N040W 34N045W  28N050W/M083F400 24N055W 19N060W DCT AMTTO DCT ANU DCT',
 'other_info': 'E/0740 P/3 R/E S/ J/ A/WHITE BLUE TAIL'}
[4]:
# write flight plan dictionary back to a string
flightplan.to_atc_plan(plan_dict)
[4]:
'(FPL-GEC8145-IN\n-B77L/H-SDE2E3FGHIJ3J4J5M1RWXYZ/SB1D1\n-EGGL1040\n-N0474F360 IMVUR1Z IMVUR N63 SAM N19 ADKIK DCT MOPAT DCT  LIMRI/M083F360 DCT 51N020W 47N030W/M083F380 40N040W 34N045W  28N050W/M083F400 24N055W 19N060W DCT AMTTO DCT ANU DCT\n\n-E/0740 P/3 R/E S/ J/ A/WHITE BLUE TAIL)'