Module atmosphere

Module atmosphere 

Source
Expand description

Enhanced atmospheric calculations for ballistics.

This module provides Rust-accelerated implementations of atmospheric calculations with full ICAO Standard Atmosphere support for improved accuracy at all altitudes.

Structs§

AtmoSock
Downrange-segmented atmosphere handler (MBA-1137), the density analogue of crate::wind::WindSock.

Enums§

PressureReferenceMode
Whether a station-pressure input is already absolute (station) pressure, or a sea-level- corrected altimeter setting (QNH / “barometer” reading) that must be reduced to station pressure at the shooter’s altitude before use (MBA-1397).

Functions§

calculate_air_density_cimp
Enhanced air density calculation using CIPM formula with ICAO atmosphere.
calculate_air_density_cipm
Legacy function name for backwards compatibility
calculate_atmosphere
Enhanced atmospheric calculation with ICAO Standard Atmosphere.
get_direct_atmosphere
Direct atmosphere calculation for simple cases.
get_local_atmosphere
Enhanced local atmospheric calculation with variable lapse rates.
get_local_atmosphere_humid
Humidity-aware companion to get_local_atmosphere: identical local density, but the speed of sound is the moist-air value (moist_speed_of_sound) evaluated at the LOCAL temperature and pressure.
moist_speed_of_sound
Speed of sound using an ideal-gas moist-air mixture approximation, first order in the water-vapor mole fraction.
reduce_qnh_to_station_pressure
Reduce a sea-level-corrected altimeter setting (QNH) to the station pressure at altitude_m (MBA-1397), using the inverse of the ICAO troposphere barometric formula:
resolve_atmosphere_for_density_altitude
Back-solve an ISA-equivalent station altitude/temperature/pressure from a directly-declared density altitude (MBA-1366) — the single-value atmosphere entry mode Shooter, Nosler, AB Analytics, Ballistic AE, and TRASOL all support as an alternative to altitude + pressure + temperature.
resolve_station_conditions
Return the station temperature and pressure that calculate_atmosphere will use after applying the default-at-altitude resolution rules.
resolve_station_conditions_with_pressure_mode
Mode-aware counterpart of resolve_station_conditions (MBA-1397): identical for PressureReferenceMode::Absolute (byte-identical delegate — resolve_station_conditions itself now forwards here), and reduces an explicit QNH pressure to station pressure via resolve_station_pressure_with_mode for PressureReferenceMode::Qnh before applying the same standard-atmosphere fallback used when either input is left at its sea-level default.
resolve_station_pressure
Resolve the station-pressure override for an air-density calculation.
resolve_station_pressure_with_mode
Mode-aware counterpart of resolve_station_pressure (MBA-1397). Does NOT change that function’s signature or behavior — PressureReferenceMode::Absolute is a pure passthrough to it — so this is a new function alongside the original, not a replacement.
resolve_station_temperature
Resolve the temperature override for an air-density calculation, mirroring resolve_station_pressure.

Type Aliases§

AtmoSegment
A single downrange-referenced atmosphere zone: (temp_c, pressure_hpa, humidity_percent, until_distance_m).