Atmosphere

pyBADA Atmosphere module Developped @EUROCONTROL (EIH) 2024

pyBADA.atmosphere.aSound(theta)[source]

Calculates the speed of sound based on the normalized air temperature.

Parameters:

theta (float) – Normalized temperature [-].

Returns:

Speed of sound in meters per second (m/s).

The speed of sound depends on air temperature and is calculated using the specific heat ratio and the gas constant.

pyBADA.atmosphere.atmosphereProperties(h, DeltaTemp)[source]

Calculates atmospheric properties: normalized temperature, pressure, and density ratios based on altitude and temperature deviation from ISA.

Parameters:
  • h (float) – Altitude in meters (m).

  • DeltaTemp (float) – Deviation from ISA temperature in Kelvin (K).

Returns:

Normalized temperature, pressure, and density ratios as a list [-].

pyBADA.atmosphere.cas2Mach(cas, theta, delta, sigma)[source]

Converts calibrated airspeed (CAS) to Mach number.

Parameters:
  • cas (float) – Calibrated airspeed in meters per second (m/s).

  • theta (float) – Normalized air temperature [-].

  • delta (float) – Normalized air pressure [-].

  • sigma (float) – Normalized air density [-].

Returns:

Mach number [-].

pyBADA.atmosphere.cas2Tas(cas, delta, sigma)[source]

Converts calibrated airspeed (CAS) to true airspeed (TAS).

Parameters:
  • cas (float) – Calibrated airspeed in meters per second (m/s).

  • sigma (float) – Normalized air density [-].

  • delta (float) – Normalized air pressure [-].

Returns:

True airspeed in meters per second (m/s).

This function inverts the compressibility adjustments to compute TAS from CAS.

pyBADA.atmosphere.convertSpeed(v, speedType, theta, delta, sigma)[source]

Calculates Mach, true airspeed (TAS), and calibrated airspeed (CAS) based on input speed and its type.

Parameters:
  • v (float) – Airspeed value, depending on the type provided (M, CAS, TAS) [-, kt, kt].

  • speedType (string) – Type of input speed, which can be one of “M” (Mach), “CAS”, or “TAS”.

  • theta (float) – Normalized air temperature [-].

  • delta (float) – Normalized air pressure [-].

  • sigma (float) – Normalized air density [-].

Returns:

A list of [Mach number, CAS in m/s, TAS in m/s].

pyBADA.atmosphere.crossOver(cas, Mach)[source]

Calculates the cross-over altitude where calibrated airspeed (CAS) and Mach number intersect.

Parameters:
  • cas (float) – Calibrated airspeed in meters per second (m/s).

  • Mach (float) – Mach number [-].

Returns:

Cross-over altitude in meters (m).

The cross-over altitude is where CAS and Mach produce the same true airspeed. The function calculates pressure and temperature at this altitude based on the given Mach number and CAS.

pyBADA.atmosphere.delta(h, DeltaTemp)[source]

Calculates the normalized pressure according to the ISA model.

Parameters:
  • h (float) – Altitude in meters (m).

  • DeltaTemp (float) – Deviation from ISA temperature in Kelvin (K).

Returns:

Normalized pressure [-].

The function uses the barometric equation for pressure changes below and above the tropopause.

pyBADA.atmosphere.hp(delta, QNH=101325.0)[source]

Calculates pressure altitude based on normalized pressure and reference pressure (QNH).

Parameters:
  • QNH (float) – Reference pressure in Pascals (Pa), default is standard sea level pressure (101325 Pa).

  • delta (float) – Normalized air pressure [-].

Returns:

Pressure altitude in meters (m).

The pressure altitude is calculated by applying the barometric formula. Below the tropopause, the altitude is computed using the standard temperature lapse rate. Above the tropopause, it applies an exponential relationship for altitude based on pressure ratio.

pyBADA.atmosphere.mach2Cas(Mach, theta, delta, sigma)[source]

Converts Mach number to calibrated airspeed (CAS).

Parameters:
  • Mach (float) – Mach number [-].

  • theta (float) – Normalized air temperature [-].

  • delta (float) – Normalized air pressure [-].

  • sigma (float) – Normalized air density [-].

Returns:

Calibrated airspeed in meters per second (m/s).

pyBADA.atmosphere.mach2Tas(Mach, theta)[source]

Converts Mach number to true airspeed (TAS).

Parameters:
  • Mach (float) – Mach number [-].

  • theta (float) – Normalized air temperature [-].

Returns:

True airspeed in meters per second (m/s).

pyBADA.atmosphere.proper_round(num, dec=0)[source]
pyBADA.atmosphere.sigma(theta, delta)[source]

Calculates the normalized air density according to the ISA model.

Parameters:
  • theta (float) – Normalized temperature [-].

  • delta (float) – Normalized pressure [-].

Returns:

Normalized air density [-].

The function uses the ideal gas law to relate pressure, temperature, and density.

pyBADA.atmosphere.tas2Cas(tas, delta, sigma)[source]

Converts true airspeed (TAS) to calibrated airspeed (CAS).

Parameters:
  • tas (float) – True airspeed in meters per second (m/s).

  • sigma (float) – Normalized air density [-].

  • delta (float) – Normalized air pressure [-].

Returns:

Calibrated airspeed in meters per second (m/s).

The function uses a complex formula to account for air compressibility effects at high speeds.

pyBADA.atmosphere.tas2Mach(v, theta)[source]

Converts true airspeed (TAS) to Mach number.

Parameters:
  • v (float) – True airspeed in meters per second (m/s).

  • theta (float) – Normalized air temperature [-].

Returns:

Mach number [-].

pyBADA.atmosphere.theta(h, DeltaTemp)[source]

Calculates the normalized temperature according to the International Standard Atmosphere (ISA) model.

Parameters:
  • h (float) – Altitude in meters (m).

  • DeltaTemp (float) – Deviation from ISA temperature in Kelvin (K).

Returns:

Normalized temperature [-].

The function accounts for whether the altitude is below or above the tropopause (11,000 m). Below the tropopause, it applies the temperature lapse rate. Above the tropopause, a constant temperature is assumed.