FlightTrajectory
pyBADA Generic flight trajectory module Developped @EUROCONTROL (EIH) 2024
- class pyBADA.flightTrajectory.FlightTrajectory[source]
Bases:
object
This class implements the flight trajectory module and handles all the operations on the flight trajectory
- addFT(AC, flightTrajectory)[source]
Adds a flight trajectory for a specific aircraft to the internal data structure.
Note
This will overwrite any previously stored flight trajectory for the same aircraft.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose trajectory is being stored.
flightTrajectory (pandas.DataFrame) – Pandas DataFrame containing the full flight trajectory for the aircraft.
- append(AC, flightTrajectoryToAppend)[source]
Appends two consecutive flight trajectories and merges them, adjusting cumulative fields such as time, distance, and fuel consumed. If the aircraft is not already present, the new trajectory will be added.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose trajectory is being appended.
flightTrajectoryToAppend (dict{list[float]}) – The second flight trajectory to append, in the form of a DataFrame.
- createFT()[source]
Creates and returns an empty DataFrame for storing aircraft flight trajectory data. This DataFrame includes various flight parameters such as altitude, speed, fuel consumption, acceleration, and more. The columns are predefined to match the data typically recorded during a flight.
- Parameters:
AC (BadaAircraft {Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}.) – Aircraft object from the BADA family (BADA3/4/H/E).
Hp (float) – Pressure altitude [ft].
TAS (float) – True Airspeed [kt].
CAS (float) – Calibrated Airspeed [kt].
M (float) – Mach number [-].
ROCD (float) – Rate of Climb/Descent [ft/min].
FUEL (float) – Fuel consumption rate [kg/s].
P (float) – Power output of the engines [W].
slope (float) – Flight path slope [degrees].
acc (float) – Aircraft acceleration [m/s^2].
THR (float) – Thrust produced by the engines [N].
config (str) – Aerodynamic configuration of the aircraft (e.g., clean, takeoff, landing).
HLid (float) – High Lift Device deployment level [-].
LG (str) – Landing gear deployment status (e.g., retracted, deployed).
mass (float) – Aircraft mass [kg].
LAT (float) – Geographical latitude [degrees].
LON (float) – Geographical longitude [degrees].
HDG (float) – Aircraft heading [degrees].
time (float) – Elapsed flight time [s].
dist (float) – Distance traveled [NM].
comment (str) – Optional comment describing the trajectory segment.
- Returns:
An empty DataFrame for flight trajectory data.
- Return type:
pd.DataFrame
- static createFlightTrajectoryDataframe(flight_data)[source]
Creates a pandas DataFrame from flight trajectory data, ensuring that all lists of data have the same length by padding shorter lists with None. This makes sure the resulting DataFrame has equal column lengths for each parameter.
- Parameters:
flight_data (dict{list[float]}) – Dictionary containing flight trajectory data, where values are lists of float values representing various parameters.
- Returns:
A pandas DataFrame representing the aircraft’s flight trajectory.
- Return type:
pandas.DataFrame
- cut(AC, parameter, threshold, direction='BELOW')[source]
Cuts the aircraft’s flight trajectory based on a specified parameter and threshold value, keeping either the data above or below the threshold, depending on the direction.
Note
The data must be sorted by the parameter for the cut to work as expected.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose flight trajectory is being modified.
parameter (str) – The name of the parameter (e.g., altitude, speed) used for filtering the data.
threshold (float) – The value of the parameter that defines the cutting point.
direction (str {'ABOVE', 'BELOW'}) – The direction of the cut. ‘ABOVE’ removes values above the threshold, ‘BELOW’ removes values below it.
- getACList()[source]
Returns a list of aircraft present in the flight trajectory object.
- Returns:
A list of BadaAircraft objects corresponding to the aircraft in the current flight trajectory.
- Return type:
list[BadaAircraft]
- getAllValues(AC, parameter)[source]
Retrieves all values for a specific parameter from the aircraft’s flight trajectory.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose flight data is being queried.
parameter (str) – The name of the parameter to retrieve values for (e.g., ‘altitude’, ‘speed’).
- Returns:
A list of values corresponding to the specified parameter throughout the flight.
- Return type:
list[float]
- getFT(AC)[source]
Returns the flight trajectory DataFrame for a specific aircraft.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose flight trajectory is being retrieved.
- Returns:
A pandas DataFrame containing the flight trajectory data of the aircraft.
- Return type:
pandas.DataFrame
- getFinalValue(AC, parameter)[source]
Retrieves the last value for a specific parameter or a list of parameters from the aircraft’s flight trajectory.
- Parameters:
AC ({Bada3Aircraft, Bada4Aircraft, BadaEAircraft, BadaHAircraft}) – Aircraft object (BADA3/4/H/E) whose flight data is being queried.
parameter (list[str] or str) – The name or list of names of the parameter(s) to retrieve the final value(s) for.
- Returns:
The last value (or list of last values) for the specified parameter(s).
- Return type:
float or list[float]
- save2csv(saveToPath, separator=',')[source]
Saves the aircraft flight trajectory data into a CSV file with a custom header depending on the BADA family. The CSV file will be saved with a timestamp in the filename.
- Parameters:
saveToPath (str) – Path to the directory where the file should be stored.
separator (str) – Separator to be used in the CSV file. Default is a comma (‘,’).
- Returns:
None
- save2kml(saveToPath)[source]
Saves the aircraft flight trajectory data into a KML (Keyhole Markup Language) file for visualization in tools like Google Earth. The KML file is generated with a timestamp in the filename and includes aircraft trajectory details with altitude extrusion.
- Parameters:
saveToPath (str) – Path to the directory where the file should be stored.
- Returns:
None
- save2xlsx(saveToPath)[source]
Saves the aircraft flight trajectory data into an Excel (.xlsx) file with a custom header depending on the BADA family. The Excel file will be saved with a timestamp in the filename.
- Parameters:
saveToPath (str) – Path to the directory where the file should be stored.
- Returns:
None