pycontrails.ext.bada.BADA3¶
- class pycontrails.ext.bada.BADA3(bada_path=None)¶
Bases:
BADA
BADA 3.15 and 3.16 Support.
Base of Aircraft Data (BADA) provides a set of ASCII files containing performance and operating procedure coefficients for 264 different aircraft types (BADA 3.16), or 250 different aircraft types (BADA 3.15). This class implements the “total energy model” as described in BADA User Manual.
- Parameters:
bada_path (
str | pathlib.Path
, optional) – Path to BADA 3.15 or 3.16 Model files. Default path set to /bada/bada3 in the parent directory of the pycontrails repository.
References
Eurocontrol. User Manual for the Base of Aircraft Data (BADA) Revision 3.16. Vol EEC Techni. Eurocontrol Experimental Centre; 2022.
Eurocontrol. User Manual for the Base of Aircraft Data (BADA) Revision 3.15. Vol EEC Techni. Eurocontrol Experimental Centre; 2019.
- __init__(bada_path=None)¶
Methods
__init__
([bada_path])calculate_aircraft_performance
(*, ...)Calculate aircraft performance along a trajectory.
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.
downselect_met
()Downselect
met
domain to the max/min bounds ofsource
.ensure_true_airspeed_on_source
()Add
true_airspeed
field tosource
data if not already present.eval
([source])Evaluate the aircraft performance model.
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.
get_source_param
(key[, default, set_attr])Get source data with default set by parameter key.
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 toflight_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.
require_met
()Ensure that
met
is a MetDataset.require_source_type
(type_)Ensure that
source
istype_
.set_source
([source])Attach original or copy of input
source
tosource
.set_source_met
(*args, **kwargs)Ensure or interpolate each required
met_variables
onsource
.simulate_fuel_and_performance
(*, ...)Calculate aircraft mass, fuel mass flow rate, and overall propulsion efficiency.
transfer_met_source_attrs
([source])Transfer met source metadata from
met
tosource
.update_params
([params])Update model parameters on
params
.Attributes
Path to BADA data directory
Aircraft type synonyms
Available/assumed aircraft-engine combinations
Engine and aircraft properties common to BADA3 and BADA4
Default path to BADA data directories
BADA version.
hash
Generate a unique hash for model instance.
interp_kwargs
Shortcut to create interpolation arguments from
params
.met
Meteorology data
met_required
Require meteorology is not None on __init__()
params
Instantiated model parameters, in dictionary form
source
Data evaluated in model
ptf_param_dict
Coefficients and properties extracted from BADA3 and BADA4 PTF files
met_variables
Required meteorology pressure level variables.
processed_met_variables
Set of required parameters if processing already complete on
met
input.optional_met_variables
Optional meteorology variables
- aircraft_engine_dataframe¶
Available/assumed aircraft-engine combinations
- aircraft_param_dict¶
Engine and aircraft properties common to BADA3 and BADA4
- calculate_aircraft_performance(*, aircraft_type, altitude_ft, air_temperature, time, true_airspeed, aircraft_mass, engine_efficiency, fuel_flow, thrust, q_fuel, **kwargs)¶
Calculate aircraft performance along a trajectory.
When
time
is not None, this method should be used for a single flight trajectory. Waypoints are coupled via thetime
parameter.This method computes the rate of climb and descent (ROCD) to determine flight phases: “cruise”, “climb”, and “descent”. Performance metrics depend on this phase.
When
time
is None, this method can be used to simulate flight performance over an arbitrary sequence of flight waypoints by assuming nominal flight characteristics. In this case, each point is treated independently and all points are assumed to be in a “cruise” phase of the flight.- Parameters:
aircraft_type (
str
) – Used to query the underlying model database for aircraft engine parameters.altitude_ft (
npt.NDArray[np.float64]
) – Altitude at each waypoint, [\(ft\)]air_temperature (
npt.NDArray[np.float64]
) – Ambient temperature for each waypoint, [\(K\)]time (
npt.NDArray[np.datetime64] | None
) – Waypoint time innp.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.float64] | float | None
) – True airspeed for each waypoint, [\(m s^{-1}\)]. If None, a nominal value is used.aircraft_mass (
npt.NDArray[np.float64] | float
) – Aircraft mass for each waypoint, [\(kg\)].engine_efficiency (
npt.NDArray[np.float64] | float | None
) – Override the engine efficiency at each waypoint.fuel_flow (
npt.NDArray[np.float64] | float | None
) – Override the fuel flow at each waypoint, [\(kg s^{-1}\)].thrust (
npt.NDArray[np.float64] | float | None
) – Override the thrust setting at each waypoint, [:math: N].q_fuel (
float
) – Lower calorific value (LCV) of fuel, [\(J \ kg_{fuel}^{-1}\)].**kwargs (
Any
) – Additional keyword arguments to pass to the model.
- Returns:
AircraftPerformanceData
– Derived performance metrics at each waypoint.
- 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 forBADA3
; it is only considered forBADA4
.
- Returns:
AircraftProperties
- 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 3.15/3.16'¶
- name = 'BADA3'¶
- path¶
Path to BADA data directory
- ptf_params_dict¶
- synonym_dict¶
Aircraft type synonyms
- version¶
BADA version. Currently only used on BADA3 class.