minisky.aero¶
Aeronautical atmosphere and airspeed conversions used by MiniSky and extension plugins.
aero
¶
Aerodynamic relations, ISA atmosphere models, and airspeed conversions.
Functions prefixed with v are vectorised and accept NumPy arrays. They use
a simplified two-layer ISA model through the lower stratosphere. The
scalar variants use the full multi-layer ISA table.
g0
module-attribute
¶
g0: GravitationalAccelerationMps2[float] = 9.80665
Gravity constant (sea level)
Tstrat
module-attribute
¶
Tstrat: StaticTemperatureK[float] = 216.65
Stratosphere temperature (up till 22km)
beta
module-attribute
¶
beta: TemperatureGradientKPerM[float] = -0.0065
Temperature gradient, below tropopause (ISA)
VectorAtmosphere
¶
Bases: NamedTuple
ScalarAtmosphere
¶
Bases: NamedTuple
vatmos
¶
vatmos(h: PressureAltitudeM) -> VectorAtmosphere
Calculate atmospheric pressure, density, and temperature for a given altitude.
Source code in packages/minisky/minisky/aero.py
48 49 50 51 52 53 54 55 56 57 58 | |
vtemp
¶
vtemp(h: PressureAltitudeM) -> StaticTemperatureK
Calculate atmospheric temperature for a given altitude.
Source code in packages/minisky/minisky/aero.py
61 62 63 64 | |
vpressure
¶
vpressure(h: PressureAltitudeM) -> StaticPressurePa
Calculate atmospheric pressure for a given altitude.
Source code in packages/minisky/minisky/aero.py
67 68 69 70 | |
vdensity
¶
vdensity(h: PressureAltitudeM) -> DensityKgPerM3
Calculate atmospheric density for a given altitude.
Source code in packages/minisky/minisky/aero.py
73 74 75 76 | |
vvsound
¶
vvsound(h: PressureAltitudeM) -> SpeedOfSoundMps
Calculate the speed of sound for a given altitude.
Source code in packages/minisky/minisky/aero.py
79 80 81 82 83 | |
vtas2mach
¶
vtas2mach(tas: TrueAirspeedMps, h: PressureAltitudeM) -> MachNumber
True airspeed (tas) to mach number conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
86 87 88 89 90 | |
vmach2tas
¶
vmach2tas(mach: MachNumber, h: PressureAltitudeM) -> TrueAirspeedMps
Mach number to True airspeed (tas) conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
93 94 95 96 97 | |
veas2tas
¶
veas2tas(eas: EquivalentAirspeedMps, h: PressureAltitudeM) -> TrueAirspeedMps
Equivalent airspeed to true airspeed conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
100 101 102 103 104 | |
vtas2eas
¶
vtas2eas(tas: TrueAirspeedMps, h: PressureAltitudeM) -> EquivalentAirspeedMps
True airspeed to equivalent airspeed conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
107 108 109 110 111 | |
vcas2tas
¶
vcas2tas(cas: CalibratedAirspeedMps, h: PressureAltitudeM) -> TrueAirspeedMps
Calibrated to true airspeed conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
114 115 116 117 118 119 120 | |
vcasmach2tas
¶
vcasmach2tas(value: ndarray, is_mach: ndarray, h: PressureAltitudeM[ndarray]) -> TrueAirspeedMps[ndarray]
Convert mixed per-lane CAS in m/s /
Mach values to TAS.
Source code in packages/minisky/minisky/aero.py
123 124 125 126 127 128 129 130 131 132 | |
vtas2cas
¶
vtas2cas(tas: TrueAirspeedMps, h: PressureAltitudeM) -> CalibratedAirspeedMps
True to calibrated airspeed conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
135 136 137 138 139 140 141 | |
vmach2cas
¶
vmach2cas(mach: MachNumber, h: PressureAltitudeM) -> CalibratedAirspeedMps
Mach to calibrated airspeed conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
144 145 146 147 148 | |
vcas2mach
¶
vcas2mach(cas: CalibratedAirspeedMps, h: PressureAltitudeM) -> MachNumber
Calibrated airspeed to Mach conversion for numpy arrays.
Source code in packages/minisky/minisky/aero.py
151 152 153 154 155 | |
crossoveralt
¶
crossoveralt(cas: CalibratedAirspeedMps[float], mach: MachNumber[float]) -> PressureAltitudeM[float]
Calculate crossover altitude for given CAS and Mach number.
Calculates the altitude where the given CAS and Mach values correspond to the same true airspeed.
(BADA User Manual 3.12, p. 12)
Source code in packages/minisky/minisky/aero.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
atmos
¶
atmos(h: PressureAltitudeM[float]) -> ScalarAtmosphere
International Standard Atmosphere calculator (scalar version).
Uses the full multi-layer ISA table up to the mesosphere, with base values corrected to avoid small discontinuities at the layer borders. Isothermal layers use an exponential pressure decay; gradient layers use the standard lapse-rate relation. Altitude is clamped to 0-86852 m.
Source code in packages/minisky/minisky/aero.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
temp
¶
temp(h: PressureAltitudeM[float]) -> StaticTemperatureK[float]
Temperature-only version of the ISA atmosphere (scalar).
Saves time relative to atmos when only the temperature is needed.
Altitude is clamped to 0-86852 m.
Source code in packages/minisky/minisky/aero.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
pressure
¶
pressure(h: PressureAltitudeM[float]) -> StaticPressurePa[float]
Calculate ISA atmospheric pressure for a given altitude (scalar).
Source code in packages/minisky/minisky/aero.py
293 294 295 296 | |
density
¶
density(h: PressureAltitudeM[float]) -> DensityKgPerM3[float]
Calculate ISA atmospheric density for a given altitude (scalar).
Source code in packages/minisky/minisky/aero.py
299 300 301 302 | |
vsound
¶
vsound(h: PressureAltitudeM[float]) -> SpeedOfSoundMps[float]
Calculate the ISA speed of sound for a given altitude (scalar).
a = sqrt(gamma * R * T)
Source code in packages/minisky/minisky/aero.py
305 306 307 308 309 310 311 312 | |
tas2mach
¶
tas2mach(tas: TrueAirspeedMps[float], h: PressureAltitudeM[float]) -> MachNumber[float]
True airspeed (tas) to mach number conversion (scalar).
Source code in packages/minisky/minisky/aero.py
315 316 317 318 319 | |
mach2tas
¶
mach2tas(M: MachNumber[float], h: PressureAltitudeM[float]) -> TrueAirspeedMps[float]
Mach number to true airspeed (tas) conversion (scalar).
Source code in packages/minisky/minisky/aero.py
322 323 324 325 326 | |
eas2tas
¶
eas2tas(eas: EquivalentAirspeedMps[float], h: PressureAltitudeM[float]) -> TrueAirspeedMps[float]
Equivalent airspeed to true airspeed conversion (scalar).
tas = eas * sqrt(rho0 / rho(h))
Source code in packages/minisky/minisky/aero.py
329 330 331 332 333 334 335 336 337 338 | |
tas2eas
¶
tas2eas(tas: TrueAirspeedMps[float], h: PressureAltitudeM[float]) -> EquivalentAirspeedMps[float]
True airspeed to equivalent airspeed conversion (scalar).
eas = tas * sqrt(rho(h) / rho0)
Source code in packages/minisky/minisky/aero.py
341 342 343 344 345 346 347 348 349 350 | |
cas2tas
¶
cas2tas(cas: CalibratedAirspeedMps[float], h: PressureAltitudeM[float]) -> TrueAirspeedMps[float]
Calibrated airspeed to true airspeed conversion (scalar).
Uses the compressible-flow relation: the impact pressure that would be measured at sea level for the given CAS is converted back to TAS using pressure and density at the given ISA altitude. Negative input speeds yield negative output speeds.
Source code in packages/minisky/minisky/aero.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
tas2cas
¶
tas2cas(tas: TrueAirspeedMps[float], h: PressureAltitudeM[float]) -> CalibratedAirspeedMps[float]
True airspeed to calibrated airspeed conversion (scalar).
Inverse of cas2tas, using the compressible-flow relation at the
given ISA altitude. Negative input speeds yield negative output
speeds.
Source code in packages/minisky/minisky/aero.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
mach2cas
¶
mach2cas(M: MachNumber[float], h: PressureAltitudeM[float]) -> CalibratedAirspeedMps[float]
Mach number to calibrated airspeed conversion (scalar).
Source code in packages/minisky/minisky/aero.py
386 387 388 389 390 391 392 | |
cas2mach
¶
cas2mach(cas: CalibratedAirspeedMps[float], h: PressureAltitudeM[float]) -> MachNumber[float]
Calibrated airspeed to Mach number conversion (scalar).
Source code in packages/minisky/minisky/aero.py
395 396 397 398 399 400 401 | |