Package aerocalc :: Module airspeed
[frames] | no frames]

Module airspeed

source code

Perform various air speed conversions.

Convert between Indicated Air Speed (IAS), Calibrated Air Speed (CAS), Equivalent Air Speed (EAS), True Air Speed (TAS) and mach number.

Convert between pitot static system pressures and air speed.

Provide interactive airspeed conversions when script is run directly, e.g. 'python airspeed.py'.

Functions
 
dp2cas(dp, press_units='in HG', speed_units='kt')
Return the CAS for a given differential pressure (the difference between the pitot and static pressures).
source code
 
dp2eas(dp, altitude, press_units='in HG', speed_units='kt', alt_units='ft')
Return the EAS for a given differential pressure (the difference between the pitot and static pressures) and altitude.
source code
 
dp2tas(dp, altitude, temp, press_units='in HG', speed_units='kt', alt_units='ft', temp_units='C')
Return the TAS for a given differential pressure (the difference between the pitot and static pressures) and altitude.
source code
 
cas2dp(cas, speed_units='kt', press_units='in HG')
Return the differential pressure (difference between pitot and static pressures) for a given CAS.
source code
 
eas2dp(eas, altitude, speed_units='kt', alt_units='ft', press_units='in HG')
Return the differential pressure (difference between pitot and static pressures) for a given EAS.
source code
 
tas2dp(tas, altitude, temp, speed_units='kt', alt_units='ft', temp_units='C', press_units='in HG')
Return the differential pressure (difference between pitot and static pressures) for a given TAS.
source code
 
cas2eas(cas, altitude, speed_units='kt', alt_units='ft')
Return the EAS for a given CAS, pressure altitude and temperature.
source code
 
i_cas2eas(data_items)
Return the EAS for a given CAS, pressure altitude and temp, with interactive input from the user.
source code
 
cas2tas(cas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')
Return the TAS for a given CAS, pressure altitude and temperature.
source code
 
i_cas2tas(data_items)
Return the TAS for a given CAS, pressure altitude and temp, with interactive input from the user.
source code
 
eas2tas(eas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')
Return the TAS for a given EAS, pressure altitude and temperature.
source code
 
i_eas2tas(data_items)
Return the TAS for a given EAS, pressure altitude and temp, with interactive input from the user.
source code
 
eas2cas(eas, altitude, speed_units='kt', alt_units='ft')
Return the CAS for a given EAS, pressure altitude and temperature.
source code
 
i_eas2cas(data_items)
Return the CAS for a given EAS, pressure altitude, with interactive input from the user.
source code
 
tas2cas(tas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')
Return the CAS for a given TAS, pressure altitude and temperature.
source code
 
i_tas2cas(data_items)
Return the CAS for a given TAS, pressure altitude and temp, with interactive input from the user.
source code
 
tas2eas(tas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')
Return the EAS for a given TAS, pressure altitude and temperature.
source code
 
i_tas2eas(data_items)
Return the EAS for a given TAS, pressure altitude and temp, with interactive input from the user.
source code
 
dp_over_p2mach(dp_over_p)
Return the mach number for a given delta p over p.
source code
 
mach2dp_over_p(M)
Return the delta p over p for a given mach number.
source code
 
cas_mach2alt(cas, mach, speed_units='kt', alt_units='ft')
Return the altitude that corresponds to a given CAS and mach.
source code
 
i_cas_mach2alt(data_items)
Return the altitude that corresponds to a given CAS and mach, with an interactive interface.
source code
 
cas_alt2mach(cas, altitude, speed_units='kt', alt_units='ft')
Return the mach that corresponds to a given CAS and altitude.
source code
 
i_cas_alt2mach(data_items)
Return the mach that corresponds to a given CAS and altitude, using an interactive interface.
source code
 
mach_alt2cas(mach, altitude, alt_units='ft', speed_units='kt')
Return the calibrated Air Speed that corresponds to a given mach and altitude.
source code
 
i_mach_alt2cas(data_items)
Return the calibrated Air Speed that corresponds to a given mach and altitude, using an interactive interface.
source code
 
mach2tas(mach, temp='std', altitude='blank', temp_units='C', alt_units='ft', speed_units='kt')
Return the TAS for a given mach number.
source code
 
i_mach2tas(data_items)
Return the TAS that corresponds to a given Mach, altitude, and temperature using an interactive interface.
source code
 
tas2mach(tas, temp='std', altitude='blank', temp_units='C', alt_units='ft', speed_units='kt')
Return the mach number for a given TAS.
source code
 
i_tas2mach(data_items)
Return the mach that corresponds to a given TAS, altitude, and temperature using an interactive interface.
source code
 
mach2temp(mach, indicated_temp, recovery_factor, temp_units='C')
Return the ambient temp, given the mach number, indicated temperature and the temperature probe's recovery factor.
source code
 
tas2temp(tas, indicated_temp, recovery_factor, speed_units='kt', temp_units='C')
Return the ambient temp, given the TAS, indicated temperature and the temperature probe's recovery factor.
source code
Variables
  default_area_units = 'ft**2'
  default_power_units = 'hp'
  default_speed_units = 'kt'
  default_temp_units = 'C'
  default_weight_units = 'lb'
  default_press_units = 'in HG'
  default_density_units = 'lb/ft**3'
  default_length_units = 'ft'
  default_alt_units = 'ft'
  default_avgas_units = 'lb'
  Rho0 = 1.225
  P0 = 101325.0
  A0 = 340.2941
  F = 166.921580093
  default_vol_units = 'ft**3'
Function Details

dp2cas(dp, press_units='in HG', speed_units='kt')

source code 

Return the CAS for a given differential pressure (the difference between the pitot and static pressures).

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

If the units are not specified, the units in default_units.py are used.

Examples:

Determine the CAS in kt that is equivalent to a differential pressure of 15 in HG: >>> dp2cas(15) 518.96637566127652

Determine the CAS in mph that is equivalent to a differential pressure of 0.2 psi: >>> dp2cas(.2, press_units = 'psi', speed_units = 'mph') 105.88275188221526

dp2eas(dp, altitude, press_units='in HG', speed_units='kt', alt_units='ft')

source code 

Return the EAS for a given differential pressure (the difference between the pitot and static pressures) and altitude.

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

This first version only works for EAS < 661.48 kt.

dp2tas(dp, altitude, temp, press_units='in HG', speed_units='kt', alt_units='ft', temp_units='C')

source code 

Return the TAS for a given differential pressure (the difference between the pitot and static pressures) and altitude.

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R.

If the units are not specified, the units in default_units.py are used.

This first version only works for TAS < 661.48 kt.

cas2dp(cas, speed_units='kt', press_units='in HG')

source code 

Return the differential pressure (difference between pitot and static pressures) for a given CAS.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

If the units are not specified, the units in default_units.py are used.

eas2dp(eas, altitude, speed_units='kt', alt_units='ft', press_units='in HG')

source code 

Return the differential pressure (difference between pitot and static pressures) for a given EAS.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

This first version only works for CAS < 661.48 kt.

tas2dp(tas, altitude, temp, speed_units='kt', alt_units='ft', temp_units='C', press_units='in HG')

source code 

Return the differential pressure (difference between pitot and static pressures) for a given TAS.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The pressure units may be in inches of HG, mm of HG, psi, lb/ft^2, hpa and mb. The units are specified as: 'in HG', 'mm HG', 'psi', 'lb/in**2', 'psf', 'lb/ft**2 'hpa', 'mb' or 'pa'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R.

If the units are not specified, the units in default_units.py are used.

This first version only works for CAS < 661.48 kt.

cas2eas(cas, altitude, speed_units='kt', alt_units='ft')

source code 

Return the EAS for a given CAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

cas2tas(cas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')

source code 

Return the TAS for a given CAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

eas2tas(eas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')

source code 

Return the TAS for a given EAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

eas2cas(eas, altitude, speed_units='kt', alt_units='ft')

source code 

Return the CAS for a given EAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the default units in default_units.py are used.

Examples:

Determine equivalent Air Speed for 250 kt CAS at 10,000 ft: >>> cas2eas(250, 10000) 248.09577137102258

Determine equivalent Air Speed for 250 mph CAS at 10,000 ft: >>> cas2eas(250, 10000, speed_units = 'mph') 248.54048288757579

i_eas2cas(data_items)

source code 

Return the CAS for a given EAS, pressure altitude, with interactive input from the user.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

tas2cas(tas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')

source code 

Return the CAS for a given TAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

Examples:

Determine the true Air Speed for 250 kt CAS at 10,000 ft with standard temperature: >>> cas2tas(250, 10000) 288.70227231079861

Determine the true Air Speed for 250 mph CAS at 10,000 ft with standard temperature: >>> cas2tas(250, 10000, speed_units = 'mph') 289.21977095514148

Determine the true Air Speed for 250 mph CAS at 10,000 ft with temperature of 0 deg C: >>> cas2tas(250, 10000, 0, speed_units = 'mph') 291.80148048806217

Determine the true Air Speed for 250 mph CAS at 10,000 ft with temperature of 0 deg F: >>> cas2tas(250, 10000, 0, speed_units = 'mph', temp_units = 'F') 282.14588227473797

i_tas2cas(data_items)

source code 

Return the CAS for a given TAS, pressure altitude and temp, with interactive input from the user.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

tas2eas(tas, altitude, temp='std', speed_units='kt', alt_units='ft', temp_units='C')

source code 

Return the EAS for a given TAS, pressure altitude and temperature.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

i_tas2eas(data_items)

source code 

Return the EAS for a given TAS, pressure altitude and temp, with interactive input from the user.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

dp_over_p2mach(dp_over_p)

source code 

Return the mach number for a given delta p over p.

Mach must be less than or equal to 10.

mach2dp_over_p(M)

source code 

Return the delta p over p for a given mach number. The result is equal to: (pitot pressure - static pressure) / static pressure

Example - determine the delta p over p at mach 0.4:

>>> mach2dp_over_p(.4)
0.11655196580975336

cas_mach2alt(cas, mach, speed_units='kt', alt_units='ft')

source code 

Return the altitude that corresponds to a given CAS and mach.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

cas_alt2mach(cas, altitude, speed_units='kt', alt_units='ft')

source code 

Return the mach that corresponds to a given CAS and altitude.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

mach_alt2cas(mach, altitude, alt_units='ft', speed_units='kt')

source code 

Return the calibrated Air Speed that corresponds to a given mach and altitude.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

If the units are not specified, the units in default_units.py are used.

mach2tas(mach, temp='std', altitude='blank', temp_units='C', alt_units='ft', speed_units='kt')

source code 

Return the TAS for a given mach number. The temperature or altitude must also be specified. If the altitude is specified, the temperature is assumed to be standard. If both the altitude and temperature are specified, the altitude input is ignored.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

Examples:

Determine the TAS in kt at 0.8 mach at a temperature of -15 deg C: >>> mach2tas(0.8, -15) 500.87884108468597

Determine the TAS in kt at 0.8 mach at 30,000 ft, assuming standard temperature: >>> mach2tas(0.8, altitude = 30000) 471.45798523415107

Determine the TAS in mph at 0.8 mach at 5000 m, assuming standard temperature: >>> mach2tas(0.8, altitude = 5000, alt_units = 'm', speed_units = 'mph') 573.60326790383715

Determine the TAS in km/h at 0.4 mach at a temperature of 300 deg K: >>> mach2tas(0.4, 300, temp_units = 'K', speed_units = 'km/h') 499.99796329569176

tas2mach(tas, temp='std', altitude='blank', temp_units='C', alt_units='ft', speed_units='kt')

source code 

Return the mach number for a given TAS. The temperature or altitude must also be specified. If the altitude is specified, the temperature is assumed to be standard. If both the altitude and temperature are specified, the altitude input is ignored.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The altitude may be in feet ('ft'), metres ('m'), kilometres ('km'), statute miles, ('sm') or nautical miles ('nm').

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.

Examples:

Determine the mach number for a TAS of 500 kt at a temperature of -15 deg C: >>> tas2mach(500, -15) 0.79859632148519943

Determine the mach number for a TAS of 500 kt at a temperature of 0 deg F: >>> tas2mach(500, 0, temp_units = 'F') 0.80292788758764277

Determine the mach number for a TAS of 500 kt at an altitude of 10,000 ft, assuming standard temperature: >>> tas2mach(500, altitude = 10000) 0.78328945665870209

Determine the mach number for a TAS of 400 mph at an altitude of 5000 m, assuming standard temperature: >>> tas2mach(400, altitude = 5000, speed_units = 'mph', alt_units = 'm') 0.55787687746166581

mach2temp(mach, indicated_temp, recovery_factor, temp_units='C')

source code 

Return the ambient temp, given the mach number, indicated temperature and the temperature probe's recovery factor.

The temperature may be in deg C, F, K or R.

If the units are not specified, the units in default_units.py are used.

Examples:

Determine the ambient temperature with an indicated temperature of -20 deg C at mach 0.6 with a probe recovery factor of 0.8:

>>> mach2temp(0.6, -20, 0.8)
-33.787291981845698

Determine the ambient temperature with an indicated temperature of 75 deg F at mach 0.3 with a probe recovery factor of 0.9:

>>> mach2temp(0.3, 75, 0.9, temp_units = 'F')
66.476427868529839

tas2temp(tas, indicated_temp, recovery_factor, speed_units='kt', temp_units='C')

source code 

Return the ambient temp, given the TAS, indicated temperature and the temperature probe's recovery factor.

The speed units may be 'kt', 'mph', 'km/h', 'm/s' and 'ft/s'.

The temperature may be in deg C, F, K or R. The temperature defaults to std temperature if it is not input.

If the units are not specified, the units in default_units.py are used.