Bada3
pyBADA Generic BADA3 aircraft performance module Developped @EUROCONTROL (EIH) 2024
- class pyBADA.bada3.ARPM(AC)[source]
Bases:
object
This class is a BADA3 aircraft subclass and implements the Airline Procedure Model (ARPM) following the BADA3 user manual.
- Parameters:
AC (bada3Aircraft.) – Aircraft object {BADA3}.
- climbSpeed(theta, delta, mass, h, DeltaTemp, speedSchedule_default=None, applyLimits=True, config=None, procedure='BADA', NADP1_ALT=3000, NADP2_ALT=[1000, 3000])[source]
Computes the climb speed schedule (CAS) for the given altitude based on various procedures and aircraft parameters.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
speedSchedule_default (list[float, float, float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vcl1, Vcl2, Mcl].
applyLimits (bool) – Boolean flag indicating whether to apply the minimum and maximum speed limits based on the flight envelope.
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
procedure (str) – Climb procedure to be followed, e.g., ‘BADA’, ‘NADP1’, ‘NADP2’. Default is ‘BADA’.
NADP1_ALT (float) – Altitude in feet for NADP1 procedure. Default is 3000 feet.
NADP2_ALT (list[float, float]) – Altitude range in feet for NADP2 procedure. Default is [1000, 3000].
- Returns:
A tuple containing the climb calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the climb speed schedule for different phases of flight and aircraft types. It supports BADA, NADP1, and NADP2 procedures for both jet and turboprop/piston/electric aircraft.
The climb schedule uses specific speed profiles depending on altitude and aircraft model. For jet engines, the speed is constrained below 250 knots below 10,000 feet, and then it follows a defined speed schedule, either from BADA or NADP procedures.
Additionally, the function applies speed limits based on the aircraft’s flight envelope, adjusting the calculated climb speed if necessary.
For procedure=’BADA’, it uses the BADA climb speed schedule.
For procedure=’NADP1’, it implements the Noise Abatement Departure Procedure 1.
For procedure=’NADP2’, it implements the Noise Abatement Departure Procedure 2.
The function also ensures that the calculated CAS remains within the bounds of the aircraft’s minimum and maximum speeds.
- cruiseSpeed(theta, delta, mass, h, DeltaTemp, speedSchedule_default=None, applyLimits=True, config=None)[source]
Computes the cruise speed schedule (CAS) for a given altitude based on aircraft parameters and procedures.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
speedSchedule_default (list[float, float, float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vcr1, Vcr2, Mcr].
applyLimits (bool) – Boolean flag indicating whether to apply the minimum and maximum speed limits based on the flight envelope.
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
- Returns:
A tuple containing the cruise calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the cruise speed schedule for various phases of flight and aircraft models. It supports both jet and turboprop/piston/electric aircraft models by using the BADA (Base of Aircraft Data) speed schedules.
If a speedSchedule_default is provided, it overwrites the BADA speed schedule.
For jet engines, the speed is constrained based on altitude, starting with 170 knots below 3000 feet, 220 knots below 6000 feet, and then follows the standard speed schedule.
For other aircraft types (TURBOPROP, PISTON, ELECTRIC), the speed limits are lower, starting with 150 knots below 3000 feet.
The function also applies limits based on the aircraft’s flight envelope, ensuring the calculated speed does not exceed the minimum or maximum allowable speeds.
- descentSpeed(theta, delta, mass, h, DeltaTemp, speedSchedule_default=None, applyLimits=True, config=None)[source]
Computes the descent speed schedule (CAS) for a given altitude based on aircraft parameters and procedures.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
speedSchedule_default (list[float, float, float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vdes1, Vdes2, Mdes].
applyLimits (bool) – Boolean flag indicating whether to apply the minimum and maximum speed limits based on the flight envelope.
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
- Returns:
A tuple containing the descent calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the descent speed schedule for various phases of flight and aircraft models. It supports both jet and turboprop/piston/electric aircraft models using the BADA (Base of Aircraft Data) speed schedules.
If a speedSchedule_default is provided, it overwrites the BADA speed schedule.
For jet and turboprop engines, the speed schedule is constrained based on altitude, starting from 220 knots below 3000 feet and then following the standard speed schedule.
For piston and electric engines, lower speed limits are applied based on stall speeds.
The function also applies limits based on the aircraft’s flight envelope, ensuring that the calculated speed does not exceed the minimum or maximum allowable speeds.
- class pyBADA.bada3.BADA3(AC)[source]
-
This class implements the part of BADA3 performance model that will be used in other classes following the BADA3 manual.
- Parameters:
AC (bada3Aircraft.) – Aircraft object {BADA3}.
- CD(CL, config, expedite=False, speedBrakes={'deployed': False, 'value': 0.03})[source]
Computes the drag coefficient based on the lift coefficient and aircraft configuration.
- Parameters:
CL (float) – Lift coefficient [-].
config (str) – Aircraft aerodynamic configuration (e.g., ‘CR’, ‘IC’, ‘TO’, ‘AP’, ‘LD’).
expedite (bool) – Flag indicating if expedite descent is used (default is False).
speedBrakes (dict) – Dictionary indicating if speed brakes are deployed and their effect.
- Returns:
Drag coefficient [-].
- Return type:
float
- Raises:
ValueError if an invalid configuration is provided.
- CL(sigma, mass, tas, nz=1.0)[source]
Computes the lift coefficient for the aircraft.
- Parameters:
sigma (float) – Normalized air density [-].
mass (float) – Aircraft mass in kilograms [kg].
tas (float) – True airspeed in meters per second [m/s].
nz (float) – Load factor [-], default is 1.0 (straight and level flight).
- Returns:
Lift coefficient [-].
- Return type:
float
- D(sigma, tas, CD)[source]
Computes the aerodynamic drag force.
- Parameters:
sigma (float) – Normalized air density [-].
tas (float) – True airspeed in meters per second [m/s].
CD (float) – Drag coefficient [-].
- Returns:
Aerodynamic drag in Newtons [N].
- Return type:
float
- L(sigma, tas, CL)[source]
Computes the aerodynamic lift force.
- Parameters:
sigma (float) – Normalized air density [-].
tas (float) – True airspeed in meters per second [m/s].
CL (float) – Lift coefficient [-].
- Returns:
Aerodynamic lift in Newtons [N].
- Return type:
float
- ROCD(T, D, v, mass, ESF, h, DeltaTemp, reducedPower=False)[source]
Computes the rate of climb or descent (ROCD) based on thrust, drag, airspeed, and other flight parameters.
- Parameters:
T (float) – Aircraft thrust in Newtons [N].
D (float) – Aircraft drag in Newtons [N].
v (float) – True airspeed (TAS) in meters per second [m/s].
mass (float) – Aircraft mass in kilograms [kg].
ESF (float) – Energy share factor [-].
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
reducedPower (bool, optional) – Whether to account for reduced power in the calculation. Default is False.
- Returns:
Rate of climb or descent in meters per second [m/s].
- Return type:
float
- TAdapted(h, DeltaTemp, ROCD, mass, v, acc, Drag)[source]
Computes adapted thrust for non-standard flight conditions (e.g., climb, acceleration).
- Parameters:
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
ROCD (float) – Rate of climb or descent in meters per second [m/s].
mass (float) – Aircraft mass in kilograms [kg].
v (float) – True airspeed (TAS) in meters per second [m/s].
acc (float) – Acceleration in meters per second squared [m/s²].
Drag (float) – Aerodynamic drag in Newtons [N].
- Returns:
Adapted thrust in Newtons [N].
- Return type:
float
- TDes(h, DeltaTemp, v, config)[source]
Computes descent thrust based on altitude, temperature deviation, and configuration.
- Parameters:
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
v (float) – True airspeed (TAS) in meters per second [m/s].
config (str) – Aircraft aerodynamic configuration (e.g., ‘CR’, ‘IC’, ‘TO’, ‘AP’, ‘LD’).
- Returns:
Descent thrust in Newtons [N].
- Return type:
float
- TMax(h, DeltaTemp, rating, v)[source]
Computes the maximum thrust based on engine type, altitude, and temperature deviation.
- Parameters:
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
rating (str) – Engine rating (‘MCMB’, ‘MCRZ’, ‘MTKF’).
v (float) – True airspeed (TAS) in meters per second [m/s].
- Returns:
Maximum thrust in Newtons [N].
- Return type:
float
- Thrust(h, DeltaTemp, rating, v, config, **kwargs)[source]
Computes the aircraft thrust based on engine rating and flight conditions.
- Parameters:
rating (str) – Engine rating (‘MCMB’, ‘MCRZ’, ‘MTKF’, ‘LIDL’, ‘ADAPTED’).
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
v (float) – True airspeed (TAS) in meters per second [m/s].
config (str) – Aircraft aerodynamic configuration (e.g., ‘CR’, ‘IC’, ‘TO’, ‘AP’, ‘LD’).
- Returns:
Thrust in Newtons [N].
- Return type:
float
- ff(h, v, T, config=None, flightPhase=None, adapted=False)[source]
Computes the fuel flow based on flight phase and current flight conditions.
- Parameters:
h (float) – Altitude in meters [m].
v (float) – True airspeed (TAS) in meters per second [m/s].
T (float) – Thrust in Newtons [N].
config (str, optional) – Aircraft aerodynamic configuration (e.g., ‘CR’, ‘AP’, ‘LD’). Optional.
flightPhase (str, optional) – Flight phase (e.g., ‘Climb’, ‘Cruise’, ‘Descent’). Optional.
adapted (bool, optional) – If True, computes fuel flow for adapted thrust. Default is False.
- Returns:
Fuel flow in kilograms per second [kg/s].
- Return type:
float
- ffMin(h)[source]
Computes the minimum fuel flow based on altitude.
- Parameters:
h (float) – Altitude in meters [m].
- Returns:
Minimum fuel flow in kilograms per second [kg/s].
- Return type:
float
- ffnom(v, T)[source]
Computes the nominal fuel flow based on airspeed and thrust.
- Parameters:
v (float) – True airspeed (TAS) in meters per second [m/s].
T (float) – Thrust in Newtons [N].
- Returns:
Nominal fuel flow in kilograms per second [kg/s].
- Return type:
float
- reducedPower(h, mass, DeltaTemp)[source]
Computes the reduced climb power coefficient based on altitude, mass, and temperature deviation.
- Parameters:
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
mass (float) – Aircraft mass in kilograms [kg].
- Returns:
Reduced climb power coefficient [-].
- Return type:
float
- class pyBADA.bada3.Bada3Aircraft(badaVersion, acName, filePath=None, allData=None)[source]
Bases:
BADA3
Implements the BADA3 performance model for an aircraft following the BADA3 manual.
This class handles the loading of aircraft-specific data from either a predefined dataset or a set of BADA3 performance model files (e.g., OPF and APF files). It initializes various parameters such as mass, speed schedules, and engine type necessary for simulating the aircraft’s performance.
- Parameters:
badaVersion (str.) – The BADA version being used.
acName (str.) – The ICAO aircraft designation (e.g., “A320”).
filePath (str, optional.) – Optional path to the BADA3 formatted file. If not provided, the default aircraft directory is used.
allData (pd.DataFrame, optional.) – Optional DataFrame containing all aircraft data. If provided, the class will try to load the aircraft data from this DataFrame.
- class pyBADA.bada3.FlightEnvelope(AC)[source]
Bases:
BADA3
This class is a BADA3 aircraft subclass and implements the flight envelope caclulations following the BADA3 manual.
- Parameters:
AC (bada3Aircraft.) – Aircraft object {BADA3}.
- VMax(h, DeltaTemp)[source]
Computes the maximum speed based on altitude and temperature deviation.
- Parameters:
h (float) – Altitude in meters [m].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
Maximum speed in meters per second [m/s].
- Return type:
float
- VMin(h, mass, config, DeltaTemp, nz=1.2, envelopeType='OPERATIONAL')[source]
Computes the minimum speed for a given configuration and conditions.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
config (str) – Aircraft configuration (e.g., ‘CR’, ‘TO’, ‘LD’).
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
nz (float, optional) – Load factor, default is 1.2.
envelopeType (str, optional) – Type of flight envelope (‘OPERATIONAL’ or ‘CERTIFIED’).
- Returns:
Minimum speed in meters per second [m/s].
- Return type:
float
- VStall(mass, config)[source]
Computes the stall speed based on the aircraft configuration and mass.
- Parameters:
config (str) – Aircraft configuration (e.g., ‘CR’, ‘TO’, ‘AP’, ‘LD’).
mass (float) – Aircraft mass in kilograms [kg].
- Returns:
Stall speed in meters per second [m/s].
- Return type:
float
- Vmax_thrustLimited(h, mass, DeltaTemp, rating, config)[source]
Computes the maximum CAS speed considering thrust limitations within the certified flight envelope.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
rating (str) – Aircraft engine rating (e.g., ‘MTKF’, ‘MCMB’, ‘MCRZ’).
config (str) – Aircraft configuration (e.g., ‘TO’, ‘CR’).
- Returns:
Maximum thrust-limited speed in meters per second [m/s].
- Return type:
float
- Vx(h, mass, DeltaTemp, rating, config)[source]
Computes the best angle of climb (Vx) speed.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
rating (str) – Aircraft engine rating (e.g., ‘MTKF’, ‘MCMB’, ‘MCRZ’).
config (str) – Aircraft configuration (e.g., ‘TO’, ‘CR’).
- Returns:
Best angle of climb speed (Vx) in meters per second [m/s].
- Return type:
float
- checkConfigurationContinuity(phase, previousConfig, currentConfig)[source]
Ensures the continuity of aerodynamic configuration changes based on the phase of flight.
- Parameters:
phase (str) – Current flight phase (‘Climb’, ‘Cruise’, ‘Descent’).
previousConfig (str) – The previous aerodynamic configuration.
currentConfig (str) – The current aerodynamic configuration.
- Returns:
Updated aerodynamic configuration.
- Return type:
str
This function ensures that the aerodynamic configuration transitions logically based on the phase of flight. For example, during descent, the configuration should not revert to a clean configuration after deploying flaps for approach or landing.
- getAeroConfig(config)[source]
Returns the aerodynamic configuration ID for a given configuration.
- Parameters:
config (str) – Aircraft configuration (e.g., ‘CR’, ‘IC’, ‘TO’, ‘AP’, ‘LD’).
- Returns:
A list containing the HLid and LG for the given configuration.
- Return type:
[int, str]
- getBankAngle(phase, flightUnit, value)[source]
Returns the nominal or maximum bank angle for the given flight phase and unit type.
- Parameters:
phase (str) – Phase of flight (e.g., ‘to’, ‘ic’, ‘cl’, ‘cr’, etc.).
flightUnit (str) – Flight unit (e.g., ‘civ’ for civilian, ‘mil’ for military).
value (str) – Desired value, either ‘nom’ for nominal or ‘max’ for maximum bank angle.
- Returns:
Bank angle in degrees [deg].
- Return type:
float
- getConfig(phase, h, mass, v, DeltaTemp, hRWY=0.0, nz=1.2)[source]
Returns the aerodynamic configuration based on altitude, speed, and phase of flight.
- Parameters:
phase (str) – Phase of flight (e.g., ‘Climb’, ‘Cruise’, ‘Descent’).
h (float) – Altitude in meters [m].
v (float) – Calibrated airspeed in meters per second [m/s].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
hRWY (float, optional) – Runway elevation above mean sea level in meters [m], default is 0.
nz (float, optional) – Load factor, default is 1.2.
- Returns:
Aerodynamic configuration (e.g., ‘TO’, ‘IC’, ‘CR’, ‘AP’, ‘LD’).
- Return type:
str
- getGroundMovementSpeed(pos)[source]
Returns the ground movement speed based on the aircraft’s position on the ground.
- Parameters:
pos (str) – Aircraft position on the airport ground (e.g., ‘backtrack’, ‘taxi’, ‘apron’, ‘gate’).
- Returns:
Ground movement speed in meters per second [m/s].
- Return type:
float
- getHoldSpeed(h, theta, delta, sigma, DeltaTemp)[source]
Computes the aircraft’s holding speed (CAS) based on the current altitude.
- Parameters:
h (float) – Altitude in meters [m].
theta (float) – Normalized temperature [-].
delta (float) – Normalized pressure [-].
sigma (float) – Normalized air density [-].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
Holding calibrated airspeed (CAS) in meters per second [m/s].
- Return type:
float
- getSpeedSchedule(phase)[source]
Returns the speed schedule for a given phase of flight.
- Parameters:
phase (str) – Flight phase (‘Climb’, ‘Cruise’, ‘Descent’).
- Returns:
A list containing CAS1, CAS2, and Mach number for the specified phase [m/s, m/s, -].
- Return type:
list[float, float, float]
- isAccOK(v1, v2, type='long', flightUnit='civ', deltaTime=1.0)[source]
Checks whether the acceleration between two time steps is within allowable limits.
- Parameters:
v1 (float) – Airspeed (or vertical speed for ‘norm’) at the previous time step [m/s].
v2 (float) – Airspeed (or vertical speed for ‘norm’) at the current time step [m/s].
type (str) – Type of acceleration to check (‘long’ for longitudinal, ‘norm’ for normal).
flightUnit (str) – Flight unit type (‘civ’ for civilian, ‘mil’ for military).
deltaTime (float) – Time difference between the two time steps in seconds [s].
- Returns:
True if the acceleration is within limits, False otherwise.
- Return type:
bool
- lowSpeedBuffetLimit(h, mass, DeltaTemp, nz=1.2)[source]
Computes the low-speed buffet limit using numerical methods.
- Parameters:
h (float) – Altitude in meters [m].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
nz (float, optional) – Load factor, default is 1.2.
- Returns:
Low-speed buffet limit as Mach number [-].
- Return type:
float
- maxAltitude(mass, DeltaTemp)[source]
Computes the maximum altitude for a given aircraft mass and deviation from ISA.
- Parameters:
mass (float) – Actual aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from International Standard Atmosphere (ISA) temperature in Kelvin [K].
- Returns:
Maximum altitude in meters [m].
- Return type:
float
This function calculates the maximum possible altitude based on the aircraft’s mass, ISA temperature deviation, and engine-specific parameters such as temperature and mass gradients. It considers the maximum operational altitude and adjusts for the given conditions.
- class pyBADA.bada3.PTD(AC)[source]
Bases:
BADA3
This class implements the PTD file creator for BADA3 aircraft following BADA3 manual.
- Parameters:
AC (bada3Aircraft.) – Aircraft object {BADA3}.
- PTD_climb(mass, altitudeList, DeltaTemp)[source]
Calculates the BADA3 PTD data in climb phase.
- Parameters:
mass (float) – Aircraft mass [kg]
altitudeList (list of int) – List of altitude levels for calculation (in feet)
DeltaTemp (float) – Deviation from International Standard Atmosphere (ISA) temperature [K]
- Returns:
A list of calculated PTD data for the climb phase
- Return type:
list
- PTD_descent(mass, altitudeList, DeltaTemp)[source]
Calculates the BADA3 PTD data in descent phase.
This function generates a detailed list of descent performance metrics for different altitudes and mass configurations based on BADA3 performance models.
- Parameters:
mass (float.) – Aircraft mass [kg].
altitudeList (list of int.) – List of aircraft altitudes in feet [ft].
DeltaTemp (float.) – Deviation from ISA temperature [K].
- Returns:
List of descent performance data.
- Return type:
list.
- create(DeltaTemp, saveToPath)[source]
Creates a BADA3 PTD file based on specified temperature deviation from ISA and saves it to the provided directory path. It generates performance data for different aircraft mass levels (low, medium, high) in both climb and descent phases.
- Parameters:
DeltaTemp (float.) – Deviation from ISA temperature in Kelvin [K].
saveToPath (str.) – Path to the directory where the PTD file will be stored.
- Returns:
None
- Return type:
None
- save2PTD(saveToPath, CLList_low, CLList_med, CLList_high, DESList_med, DeltaTemp)[source]
Saves BADA3 (PTD) to a file. It stores performance data for low, medium, and high aircraft masses during the climb phase, and medium aircraft mass during the descent phase. The file is saved in a predefined format.
- Parameters:
saveToPath (str.) – Path to the directory where the PTD file should be saved.
CLList_low (list.) – List containing PTD data for CLIMB at low aircraft mass.
CLList_med (list.) – List containing PTD data for CLIMB at medium aircraft mass.
CLList_high (list.) – List containing PTD data for CLIMB at high aircraft mass.
DESList_med (list.) – List containing PTD data for DESCENT at medium aircraft mass.
DeltaTemp (float.) – Deviation from ISA temperature in Kelvin [K].
- Returns:
None
- class pyBADA.bada3.PTF(AC)[source]
Bases:
BADA3
This class implements the PTF file creator for BADA3 aircraft following BADA3 manual.
- Parameters:
AC (bada3Aircraft.) – Aircraft object {BADA3}.
- PTF_climb(massList, altitudeList, DeltaTemp)[source]
Calculates BADA3 PTF data for the climb phase.
- Parameters:
massList (list of float.) – List of aircraft masses [kg] (low, nominal, high).
altitudeList (list of int.) – List of aircraft altitudes [ft].
DeltaTemp (float.) – Deviation from the International Standard Atmosphere (ISA) temperature [K].
- Returns:
List containing climb phase TAS, ROCD, and fuel flow data.
- Return type:
list.
- PTF_cruise(massList, altitudeList, DeltaTemp)[source]
Calculates BADA3 PTF data for the cruise phase.
- Parameters:
massList (list of float.) – List of aircraft masses [kg] (low, nominal, and high).
altitudeList (list of int.) – List of aircraft altitudes [ft].
DeltaTemp (float.) – Deviation from the International Standard Atmosphere (ISA) temperature [K].
- Returns:
List containing cruise phase TAS and fuel flow data.
- Return type:
list.
- PTF_descent(massList, altitudeList, DeltaTemp)[source]
Calculates BADA3 PTF data for the descent phase.
- Parameters:
massList (list of float.) – List of aircraft masses [kg] (low, nominal, high).
altitudeList (list of int.) – List of aircraft altitudes [ft].
DeltaTemp (float.) – Deviation from the International Standard Atmosphere (ISA) temperature [K].
- Returns:
List containing descent phase TAS, ROCD, and fuel flow data.
- Return type:
list.
- create(DeltaTemp, saveToPath)[source]
Creates a BADA3 PTF file based on specified temperature deviation from ISA and saves it to the provided directory path. It generates performance data for different aircraft mass levels (low, medium, high) in both climb and descent phases.
- Parameters:
DeltaTemp (float.) – Deviation from ISA temperature in Kelvin [K].
saveToPath (str.) – Path to the directory where the PTF file will be stored.
- Returns:
None
- Return type:
None
- save2PTF(saveToPath, CRList, CLList, DESList, altitudeList, massList, DeltaTemp)[source]
Saves performance data to a PTF file.
- Parameters:
saveToPath (string.) – Directory path where the PTF file will be stored.
CRList (list.) – List of cruise phase data.
CLList (list.) – List of climb phase data.
DESList (list.) – List of descent phase data.
altitudeList (list of int.) – List of aircraft altitudes [ft].
massList (list of int.) – List of aircraft masses [kg].
DeltaTemp (float.) – Deviation from ISA temperature [K].
- Returns:
None
- class pyBADA.bada3.Parser[source]
Bases:
object
This class implements the BADA3 parsing mechanism to parse APF, OPF and GPF BADA3 files.
- static combineACDATA_GPF(ACDataFrame, GPFDataframe)[source]
Combines two DataFrames: one containing aircraft-specific data (ACData) and another containing (GPF) data.
- Parameters:
ACDataFrame (pd.DataFrame) – DataFrame containing parsed aircraft data.
GPFDataframe (pd.DataFrame) – DataFrame containing parsed GPF data.
- Returns:
A combined DataFrame containing both ACData and GPF data.
- Return type:
pd.DataFrame
- static combineOPF_APF(OPFDataFrame, APFDataFrame)[source]
Combines data from OPF and APF DataFrames.
- Parameters:
OPFDataFrame (pd.DataFrame) – DataFrame containing parsed data from the OPF file.
APFDataFrame (pd.DataFrame) – DataFrame containing parsed data from the APF file.
- Returns:
A single DataFrame combining both OPF and APF data.
- Return type:
pd.DataFrame
- static findData(f)[source]
Searches for specific data lines in an open file stream.
- Parameters:
f (file object) – An open file object from which lines are read.
- Returns:
A tuple containing the file object and a parsed line split into a list, or None if no relevant line is found.
- Return type:
tuple(file object, list of str or None)
This function reads the file line by line until it finds a line that starts with “CD”. Once found, the line is stripped of extra spaces, split into a list, and returned. If no such line is found, it returns None for the line.
- static getGPFValue(GPFdata, name, engine='JET', phase='cr', flight='civ')[source]
Retrieves the value of a specified GPF parameter based on engine type, flight phase, and flight type.
- Parameters:
GPFdata (list) – List of dictionaries containing GPF parameters.
name (str) – Name of the GPF parameter to retrieve.
engine (str) – Engine type to filter by (e.g., ‘JET’, ‘TURBOPROP’, ‘PISTON’, ‘ELECTRIC’). Default is ‘JET’.
phase (str) – Flight phase to filter by (e.g., ‘cr’, ‘cl’, ‘des’). Default is ‘cr’.
flight (str) – Flight type to filter by (‘civ’ or ‘mil’). Default is ‘civ’.
- Returns:
The value of the specified GPF parameter or None if not found.
- Return type:
float or None
- static parseAPF(filePath, acName)[source]
Parses a BADA3 APF ASCII formatted file for aircraft performance data.
- Parameters:
filePath (str) – Path to the BADA3 APF ASCII formatted file.
acName (str) – ICAO aircraft designation (e.g., ‘A320’).
- Raises:
IOError – If the file cannot be opened or read.
- Returns:
A pandas DataFrame containing the parsed aircraft performance data.
- Return type:
pd.DataFrame
- static parseAll(badaVersion, filePath=None)[source]
Parses all BADA3 formatted files and combines them into a final DataFrame.
- Parameters:
badaVersion (str) – BADA version being used.
filePath (str, optional) – Path to the BADA3 formatted files. If not provided, the default path is used.
- Returns:
A pandas DataFrame containing all parsed BADA3 data.
- Return type:
pd.DataFrame
- Raises:
IOError – If any of the required files cannot be opened or read.
- static parseGPF(filePath)[source]
Parses a BADA3 (GPF) from either ASCII or XML format.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
- Returns:
A pandas DataFrame containing GPF data.
- Return type:
pd.DataFrame
- static parseOPF(filePath, acName)[source]
Parses a BADA3 OPF (Operational Performance File) ASCII formatted file for aircraft performance data.
- Parameters:
filePath (str) – Path to the BADA3 OPF ASCII formatted file.
acName (str) – ICAO aircraft designation (e.g., ‘A320’).
- Raises:
IOError – If the file cannot be opened or read.
- Returns:
A pandas DataFrame containing the parsed aircraft performance data.
- Return type:
pd.DataFrame
- static parseSynonym(filePath, acName)[source]
Parses either the ASCII or XML synonym file and returns the file name corresponding to the aircraft.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
acName (str) – ICAO aircraft designation for which the file name is needed.
- Returns:
The file name corresponding to the aircraft, or None if not found.
- Return type:
str or None
This function first attempts to read the aircraft synonym from the ASCII file (‘SYNONYM.NEW’). If the synonym is not found, it then tries to read the XML version (‘SYNONYM.xml’). It returns the associated file name or None if the aircraft synonym is not found.
- static parseXML(filePath, acName)[source]
Parses a BADA3 XML formatted file for aircraft performance data.
- Parameters:
filePath (str) – Path to the XML file containing BADA data.
acName (str) – Name of the aircraft for which data is being parsed from the XML file.
- Raises:
IOError – If the file cannot be found or read.
ValueError – If the BADA version is unsupported or if parsing fails.
- Returns:
A pandas DataFrame containing the parsed aircraft performance data.
- Return type:
pd.DataFrame
- static readGPF(filePath)[source]
Parses a BADA3 GPF ASCII formatted file.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
- Raises:
IOError – If the GPF file cannot be opened or read.
- Returns:
A list of dictionaries, each containing GPF parameters like engine type, flight phase, and parameter values.
- Return type:
list of dict
- static readGPFXML(filePath)[source]
Parses a BADA3 GPF XML formatted file.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
- Raises:
IOError – If the XML file is not found or cannot be read.
- Returns:
A list of dictionaries, each containing GPF parameters such as engine type, flight phase, and performance values.
- Return type:
list of dict
This function reads the ‘GPF.xml’ file and extracts general performance parameters for the aircraft, including maximum acceleration, bank angles, thrust coefficients, speed limits, and more. It parses the XML structure and returns a list of dictionaries representing these parameters.
- static readSynonym(filePath)[source]
Reads a BADA3 SYNONYM.NEW ASCII file and returns a dictionary of model-synonym pairs.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
- Returns:
A dictionary where the keys are aircraft models and the values are the corresponding file names.
- Return type:
dict
- static readSynonymXML(filePath)[source]
Reads a BADA3 SYNONYM.xml file and returns a dictionary of model-synonym pairs.
- Parameters:
filePath (str) – Path to the directory containing BADA3 files.
- Returns:
A dictionary where the keys are aircraft models (codes) and the values are the corresponding file names.
- Return type:
dict
- Raises:
IOError – If the XML file is not found or cannot be read.
This function parses the ‘SYNONYM.xml’ file to extract aircraft model codes and their associated file names. If the XML file is not found or is improperly formatted, an IOError is raised.