Atmo
Atmo
Atmospheric conditions and density calculations
Properties
altitude: Altitude relative to sea level pressure: Unadjusted barometric pressure, a.k.a. station pressure temperature: Temperature humidity: Relative humidity [0% to 100%] powder_temp: Temperature of powder (if different from atmosphere). (Used when Ammo.use_powder_sensitivity is True) density_ratio: Ratio of current density to standard atmospheric density mach: Velocity of sound (Mach 1) for current atmosphere
Parameters:
Name | Type | Description | Default |
---|---|---|---|
altitude
|
Optional[Union[float, Distance]]
|
Altitude relative to sea level |
None
|
pressure
|
Optional[Union[float, Pressure]]
|
Atmospheric pressure |
None
|
temperature
|
Optional[Union[float, Temperature]]
|
Atmospheric temperature |
None
|
humidity
|
float
|
Atmospheric relative humidity [0% to 100%] |
0.0
|
powder_t
|
Optional[Union[float, Temperature]]
|
Custom temperature of powder different to atmospheric. Used when Ammo.use_powder_sensitivity is True |
None
|
Example
This is how you can create an Atmo
from py_ballisticcalc import Atmo
atmo = Atmo(
altitude=Unit.Meter(100),
pressure=Unit.hPa(1000),
temperature=Unit.Celsius(20),
humidity=50,
powder_t=Unit.Celsius(15)
)
Source code in py_ballisticcalc\conditions.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
humidity
property
writable
¶
humidity: float
Returns:
Type | Description |
---|---|
float
|
Relative humidity [0% to 100%] |
density_ratio
property
¶
density_ratio: float
Ratio of current density to standard atmospheric density
density_imperial
property
¶
density_imperial: float
Returns:
Type | Description |
---|---|
float
|
density in lb/ft^3 |
temperature_at_altitude ¶
Temperature at altitude interpolated from zero conditions using lapse rate. Args: altitude: ASL in ft Returns: temperature in °C
Source code in py_ballisticcalc\conditions.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
update_density_ratio ¶
update_density_ratio() -> None
Updates the density ratio based on current conditions
Source code in py_ballisticcalc\conditions.py
126 127 128 129 130 |
|
pressure_at_altitude ¶
Pressure at altitude interpolated from zero conditions using lapse rate. Ref: https://en.wikipedia.org/wiki/Barometric_formula#Pressure_equations Args: altitude: ASL in ft Returns: pressure in hPa
Source code in py_ballisticcalc\conditions.py
164 165 166 167 168 169 170 171 172 173 174 175 |
|
get_density_factor_and_mach_for_altitude ¶
Ref: https://en.wikipedia.org/wiki/Barometric_formula#Density_equations Args: altitude: ASL in units of feet. Note: Altitude above 36,000 ft not modelled this way. Returns: density ratio and Mach 1 (fps) for the specified altitude
Source code in py_ballisticcalc\conditions.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
standard_temperature
staticmethod
¶
standard_temperature(altitude: Distance) -> Temperature
Note: This model only valid up to troposphere (~36,000 ft). Args: altitude: ASL in units of feet. Returns: ICAO standard temperature for altitude
Source code in py_ballisticcalc\conditions.py
212 213 214 215 216 217 218 219 220 221 222 |
|
standard_pressure
staticmethod
¶
standard_pressure(altitude: Distance) -> Pressure
This model only valid up to troposphere (~36,000 ft).
Ref: https://en.wikipedia.org/wiki/Barometric_formula#Pressure_equations
Args: altitude: Distance above sea level (ASL) Returns: ICAO standard pressure for altitude
Source code in py_ballisticcalc\conditions.py
224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
icao
staticmethod
¶
icao(altitude: Union[float, Distance] = 0, temperature: Optional[Temperature] = None, humidity: float = cStandardHumidity) -> Atmo
Note: This model only valid up to troposphere (~36,000 ft). Args: altitude: relative to sea level temperature: air temperature Returns: Atmo instance of standard ICAO atmosphere at given altitude. If temperature not specified uses standard temperature.
Source code in py_ballisticcalc\conditions.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
machF
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fahrenheit
|
float
|
Fahrenheit temperature |
required |
Returns: Mach 1 in fps for given temperature
Source code in py_ballisticcalc\conditions.py
258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
machC
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
celsius
|
float
|
Celsius temperature |
required |
Returns: Mach 1 in m/s for Celsius temperature
Source code in py_ballisticcalc\conditions.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
machK
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kelvin
|
float
|
Kelvin temperature |
required |
Returns: Mach 1 in m/s for Kelvin temperature
Source code in py_ballisticcalc\conditions.py
287 288 289 290 291 292 293 294 295 |
|
calculate_air_density
staticmethod
¶
Calculate the air density given temperature, pressure, and humidity.
Parameters: t (float): Temperature in degrees Celsius. p (float): Pressure in hPa. humidity (float): The relative humidity as a fraction of max [0%-100%]
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
Air density in kg/m^3. |
Notes: - Divide result by cDensityImperialToMetric to get density in lb/ft^3 - Source: https://www.nist.gov/system/files/documents/calibrations/CIPM-2007.pdf
Source code in py_ballisticcalc\conditions.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
Vacuum
Bases: Atmo
Vacuum atmosphere has zero drag
Source code in py_ballisticcalc\conditions.py
367 368 369 370 371 372 373 |
|
update_density_ratio ¶
update_density_ratio()
Source code in py_ballisticcalc\conditions.py
375 376 |
|