pycontrails.ext.bada.BADA4

class pycontrails.ext.bada.BADA4(bada_path=None)

Bases: BADA

BADA 4.2 Support.

Base of Aircraft Data (BADA) provides a set of ASCII files containing performance and operating procedure coefficients.`

Parameters:

bada_path (str | pathlib.Path, optional) – Path to BADA 4.2 Model files Default path set to /bada/bada4 in the parent directory of the pycontrails repository.

References

  • Eurocontrol. User Manual for the Base of Aircraft Data (BADA) Family 4.

    Vol EEC Techni. Eurocontrol Experimental Centre; 2016.

__init__(bada_path=None)

Methods

__init__([bada_path])

assumed_aircraft_engine_type_bada4(...)

Get the assumed aircraft type for BADA4.

calculate_aircraft_performance(*, ...)

See pycontrails.ext.bada.BADAFlight for usage.

check_aircraft_type_availability(aircraft_type)

Check if aircraft type designator is available in BADA database.

clip_fuel_flow_by_ptf_bounds(atyp_icao, ...)

Clip array of fuel flow by the BADA PTF-defined thresholds.

correct_fuel_flow(atyp_icao, fuel_flow, ...)

Correct unrealistic fuel mass flow rate by clipping to PTF nominals.

get_aircraft_engine_properties(atyp_icao[, ...])

Extract the aircraft performance and engine properties from the BADA database.

get_aircraft_params(aircraft_type)

Get aircraft params associated to aircraft type.

get_ptf_params(aircraft_type)

Get PTF params associated to aircraft type.

is_within_thrust_limits(*, atyp_bada, ...)

Determine whether thrust required at each waypoint is within bounds of BADA model.

nominal_cruising_speed(aircraft_type, alt_ft)

Compute nominal cruising speed at altitude by interpolating over PTF data.

nominal_fuel_flow(aircraft_type, alt_ft, phase)

Compute nominal fuel flow depending on phase based on PTF data.

nominal_fuel_flow_from_flight_phase(...)

Call nominal_fuel_flow() for each phase according to flight_phase.

nominal_roc(aircraft_type, alt_ft)

Compute nominal rate of climb at altitude by interpolating over PTF data.

nominal_rod(aircraft_type, alt_ft)

Compute nominal rate of descent at altitude by interpolating over PTF data.

Attributes

path

Path to BADA data directory

synonym_dict

Aircraft type synonyms

aircraft_engine_dataframe

Available/assumed aircraft-engine combinations

ptf_params_dict

aircraft_param_dict

Engine and aircraft properties common to BADA3 and BADA4

default_path

Default path to BADA data directories

version

BADA version.

long_name

name

aircraft_engine_options

ptf_param_dict

Coefficients and properties extracted from BADA3 and BADA4 PTF files

aircraft_engine_dataframe

Available/assumed aircraft-engine combinations

aircraft_engine_options
aircraft_param_dict

Engine and aircraft properties common to BADA3 and BADA4

assumed_aircraft_engine_type_bada4(atyp_icao, engine_uid)

Get the assumed aircraft type for BADA4.

Parameters:
  • atyp_icao (str) – ICAO aircraft type designator

  • engine_uid (None | str) – Engine unique identification number from the ICAO EDB. If None is provided or engine_uid is unidentified, the default aircraft-engine combination from BADA4 is used.

Returns:

pandas.Series – Assumed aircraft and engine type

calculate_aircraft_performance(*, aircraft_type, altitude_ft, air_temperature, time, true_airspeed, aircraft_mass, engine_efficiency, fuel_flow, thrust, q_fuel, **kwargs)

See pycontrails.ext.bada.BADAFlight for usage.

check_aircraft_type_availability(aircraft_type, raise_error=True)

Check if aircraft type designator is available in BADA database.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • raise_error (bool, optional) – Optional flag for raising an error, by default True.

Returns:

bool – Aircraft found in BADA database.

Raises:

KeyError – raises KeyError if the aircraft type is not covered by database

clip_fuel_flow_by_ptf_bounds(atyp_icao, alt_ft, fuel_flow, phase, buffer=0.1)

Clip array of fuel flow by the BADA PTF-defined thresholds.

Often, especially at high altitudes, the BADA “hi” and “lo” values both coincide with the “nom” values. Consequently, it is impossible for a predicted fuel flow to fall within the PTF range. To account for this, values within +/- 10% of nominal are considered in range.

Parameters:
  • atyp_icao (str) – ICAO aircraft type designator.

  • alt_ft (npt.NDArray[np.floating]) – Array of altitude values, [\(ft\)]

  • fuel_flow (npt.NDArray[np.floating]) – Values to clip

  • phase (str, optional) – One of “cruise”, “climb”, or “descent”. By default, “cruise”.

  • buffer (float, optional) – Custom nominal buffer, [:math: 0 - 1] Values within buffer of nominal are considered “within range”. By default, 0.1.

Returns:

npt.NDArray[np.floating] – Clipped fuel flow

correct_fuel_flow(atyp_icao, fuel_flow, altitude_ft, flight_phase)

Correct unrealistic fuel mass flow rate by clipping to PTF nominals.

The BADA PTF files provide “guardrails” for fuel flow values within a specified flight phase (climb, cruise, descent). Specifically, the PTF files provide a nominal, a high, and low value for fuel flows.

The high and low PTF values often fail to provide a sufficiently wide range for fuel flow. To address this, an additional buffer is applied to the nominal values. The adjust PTF ranges take the form

ptf_adjusted_low = minimum(ptf_nom - buffer, ptf_low) ptf_adjusted_high = minimum(ptf_nom + buffer, ptf_high)

This implementation hard codes distinct buffer thresholds for the climb, cruise, and descent phases of flights. These buffers were tuned on real-world flight recorder data to optimize BADA’s predictive quality. These values could be revisited with additional flight recorder data or improved BADA models.

Parameters:
  • atyp_icao (str) – ICAO aircraft type designator.

  • fuel_flow (npt.NDArray[np.floating]) – Uncorrected fuel mass flow rate, [\(kg s^{-1}\)]

  • altitude_ft (npt.NDArray[np.floating]) – Array of altitude values, [\(ft\)]

  • flight_phase (npt.NDArray[np.uint8] | flight.FlightPhase) – Phase state of each waypoint.

Returns:

npt.NDArray[np.floating] – Corrected fuel mass flow rate, [\(kg s^{-1}\)]

default_params

alias of AircraftPerformanceParams

default_path

Default path to BADA data directories

get_aircraft_engine_properties(atyp_icao, engine_uid=None)

Extract the aircraft performance and engine properties from the BADA database.

Parameters:
  • atyp_icao (str) – ICAO aircraft type designator.

  • engine_uid (str) – Engine unique identification number from the ICAO EDB. If None is provided or engine_uid is unidentified, default aircraft-engine combination from BADA will be used. This parameter is unused for BADA3; it is only considered for BADA4.

Returns:

AircraftProperties

get_aircraft_params(aircraft_type)

Get aircraft params associated to aircraft type.

Parameters:

aircraft_type (str) – ICAO aircraft type designator, or BADA-specific aircraft type.

Returns:

AircraftParams – Value from aircraft_param_dict.

get_ptf_params(aircraft_type)

Get PTF params associated to aircraft type.

Parameters:

aircraft_type (str) – ICAO aircraft type designator, or BADA-specific aircraft type.

Returns:

PTFParams – Value from ptf_param_dict.

is_within_thrust_limits(*, atyp_bada, altitude_ft, air_temperature, time, true_airspeed, aircraft_mass, thrust, flight_phase)

Determine whether thrust required at each waypoint is within bounds of BADA model.

If thrust is not provided as input, it will be computed according to BADA standards. Thrust limits are only defined for the BADA3 model. For BADA4, this function will raise a NotImplementedError.

Parameters:
  • atyp_bada (str) – ICAO aircraft type designator (BADA 3), or long aircraft type designator (BADA 4).

  • altitude_ft (npt.NDArray[np.floating]) – Altitude at each waypoint, [\(ft\)]

  • air_temperature (npt.NDArray[np.floating]) – Ambient temperature for each waypoint, [\(K\)]

  • time (npt.NDArray[np.datetime64] | None) – Waypoint time in np.datetime64 format. If None, only drag force will is used in thrust calculations (ie, no vertical change and constant horizontal change). In addition, aircraft is assumed to be in cruise.

  • true_airspeed (npt.NDArray[np.floating] | float | None) – True airspeed for each waypoint, [\(m s^{-1}\)]. If None, the nominal BADA cruise value is used.

  • aircraft_mass (npt.NDArray[np.floating] | float | None) – Aircraft mass for each waypoint, [\(kg\)]. If None, the nominal BADA value is used.

  • thrust (npt.NDArray[np.floating] | float | None) – Override the thrust setting at each waypoint, [:math: N].

  • flight_phase (npt.NDArray[np.uint8] | flight.FlightPhase | None) – Flight phase for each waypoint. If None, the flight phase is assumed to be cruise.

Returns:

npt.NDArray[np.bool_] – Boolean array telling whether the thrust at each waypoint is within BADA trust limits

long_name = 'Base of Aircraft Data (BADA) Revision 4.2'
name = 'BADA4'
nominal_cruising_speed(aircraft_type, alt_ft)

Compute nominal cruising speed at altitude by interpolating over PTF data.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • alt_ft (ArrayOrFloat) – Array of altitude values, [\(ft\)]

Returns:

ArrayOrFloat – Nominal cruising speed according to BADA, [\(m/s\)]

nominal_fuel_flow(aircraft_type, alt_ft, phase, type='nom')

Compute nominal fuel flow depending on phase based on PTF data.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • alt_ft (ArrayOrFloat) – Array of altitude values, [\(ft\)]

  • phase (str) – One of “cruise”, “climb”, or “descent”

  • type (str, optional) – One of “nom”, “hi”, or “lo”.

Returns:

ArrayOrFloat – Nominal fuel flow, [\(kg \ s^{-1}\)]

See also

calculate_aircraft_performance(), by, drag, and

nominal_fuel_flow_from_flight_phase(aircraft_type, alt_ft, flight_phase)

Call nominal_fuel_flow() for each phase according to flight_phase.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • alt_ft (ArrayOrFloat) – Array of altitude values, [\(ft\)]

  • flight_phase (npt.NDArray[np.uint8] | flight.FlightPhase) – Phase state of each waypoint.

Returns:

npt.NDArray[np.floating] – Nominal PTF fuel flow, [\(kg s^{-1}\)].

nominal_roc(aircraft_type, alt_ft)

Compute nominal rate of climb at altitude by interpolating over PTF data.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • alt_ft (ArrayOrFloat) – Array of altitude values, [\(ft\)]

Returns:

ArrayOrFloat – Nominal rate of climb according to BADA, [\(ft \ min^{-1}\)]

nominal_rod(aircraft_type, alt_ft)

Compute nominal rate of descent at altitude by interpolating over PTF data.

Parameters:
  • aircraft_type (str) – ICAO aircraft type designator (BADA 3), or aircraft model (BADA 4)

  • alt_ft (ArrayOrFloat) – Array of altitude values, [\(ft\)]

Returns:

ArrayOrFloat – Nominal rate of descent according to BADA, [\(ft \ min^{-1}\)]

path

Path to BADA data directory

ptf_param_dict

Coefficients and properties extracted from BADA3 and BADA4 PTF files

ptf_params_dict
synonym_dict

Aircraft type synonyms

version

BADA version. Currently only used on BADA3 class.