pycontrails.core.flightplan

ATC Flight Plan Parser.

Functions

parse_atc_plan(atc_plan)

Parse an ATC flight plan string into a dictionary.

parse_ofp_xml(raw_xml)

Parse an ARINC 633 Operational Flight Plan (OFP) XML into a Flight object.

to_atc_plan(plan)

Write dictionary from parse_atc_plan() as ATC flight plan string.

pycontrails.core.flightplan.parse_atc_plan(atc_plan)

Parse an ATC flight plan string into a dictionary.

The route string is not converted to lat/lon in this process.

Parameters:

atc_plan (str) – An ATC flight plan string conforming to ICAO Doc 4444-ATM/501 (Appendix 2)

Returns:

dict[str, str] – A dictionary consisting of parsed components of the ATC flight plan. A full ATC plan will contain the keys:

  • callsign: ICAO flight callsign

  • flight_rules: Flight rules (“I”, “V”, “Y”, “Z”)

  • type_of_flight: Type of flight (“S”, “N”, “G”, “M”, “X”)

  • number_aircraft: The number of aircraft, if more than one

  • type_of_aircraft: ICAO aircraft type

  • wake_category: Wake turbulence category

  • equipment: Radiocommunication, navigation and approach aid equipment and capabilities

  • transponder: Surveillance equipment and capabilities

  • departure_icao: ICAO departure airport

  • time: Estimated off-block (departure) time (UTC)

  • speed_type: Speed units (“K”: km / hr, “N”: knots)

  • speed: Cruise true airspeed in speed_type units

  • level_type: Level units (“F”, “S”, “A”, “M”)

  • level: Cruise level

  • route: Route string

  • destination_icao: ICAO destination airport

  • duration: The total estimated elapsed time for the flight plan

  • alt_icao: ICAO alternate destination airport

  • second_alt_icao: ICAO second alternate destination airport

  • other_info: Other information

  • supplementary_info: Supplementary information

References

See also

to_atc_plan()

pycontrails.core.flightplan.parse_ofp_xml(raw_xml)

Parse an ARINC 633 Operational Flight Plan (OFP) XML into a Flight object.

Extracts waypoint-level information such as latitude, longitude, altitude, and time for the main flight plan (departure, waypoints, arrival) to construct a Flight instance.

Parameters:

raw_xml (str | bytes | IO[str] | IO[bytes]) – String, bytes, or file-like object containing the ARINC 633 XML data.

Returns:

Flight – A Flight instance containing the parsed waypoints.

pycontrails.core.flightplan.to_atc_plan(plan)

Write dictionary from parse_atc_plan() as ATC flight plan string.

Parameters:

plan (dict[str, Any]) – Dictionary representation of ATC flight plan returned from parse_atc_plan().

Returns:

str – ATC flight plan string conforming to ICAO Doc 4444-ATM/501

See also

parse_atc_plan()