Flight Plan¶
- compute_flight_plan(aircraft, flight_sequence, takeoff_airport=None, return_airport=None, start_offset=5, end_offset=1)[source]¶
Compute a flight plan with segment classifications.
- Return type:
GeoDataFrame- Parameters:
- Segment types are determined as follows:
“takeoff” for the very first ascending phase,
“climb” for any subsequent ascending phase,
“transit” for level flight,
“descent” for descending flight,
“flight_line” for dedicated flight line segments,
“approach” for the final descending phase into the return airport.
- create_flight_line_record(flight_line, aircraft)[source]¶
Create a flight line record dictionary for inclusion in a flight plan DataFrame.
- Parameters:
flight_line (FlightLine) – The flight line to convert.
aircraft (Aircraft) – Aircraft used to compute segment timing.
- Returns:
- Record with geometry, endpoints, altitudes (feet), headings,
time (minutes), segment type, and distance (nautical miles).
- Return type:
- process_flight_phase(start, end, phase_info, segment_name)[source]¶
Process a flight phase using the detailed phase_info.
For each sub-phase in phase_info[“phases”], this function determines the segment type based on the altitude change:
If ascending, the phase is labeled “takeoff” when segment_name is “Departure”, otherwise “climb”.
If descending, the phase is labeled “approach” when segment_name is “Arrival”, otherwise “descent”.
If no altitude change, the phase is labeled “transit”.
Returns a list of record dictionaries for inclusion in the flight plan.
- plot_flight_plan(flight_plan_gdf, takeoff_airport, return_airport, flight_sequence)[source]¶
Plot the computed flight plan on a 2D map with airports, waypoints, and flight lines.
- terrain_profile_along_track(flight_plan_gdf, dem_file=None)[source]¶
Sample terrain elevation along the flight plan track.
Extracts lat/lon points from each segment geometry, queries DEM elevation, and returns arrays of cumulative time and terrain height.
- Parameters:
flight_plan_gdf (GeoDataFrame) – Flight plan from compute_flight_plan().
dem_file (str, optional) – Path to DEM file. If None, one is auto-downloaded.
- Returns:
- (times, elevations) where times is cumulative minutes and
elevations is terrain height in feet MSL, both as numpy arrays.
- Return type:
- plot_altitude_trajectory(flight_plan_gdf, aircraft=None, dem_file=None, show_terrain=True)[source]¶
Plot altitude vs. time trajectory with optional terrain profile.
If an Aircraft is provided, climb/takeoff segments are drawn with the realistic curved profile (ROC decreases with altitude). Otherwise all segments are drawn as straight lines.
- Parameters:
flight_plan_gdf (GeoDataFrame) – Flight plan from compute_flight_plan().
aircraft (Aircraft, optional) – Aircraft used for the flight plan.
dem_file (str, optional) – Path to DEM file for terrain. If None, auto-downloaded.
show_terrain (bool) – If True, overlay terrain elevation beneath the flight path.