Atmo
Atmo
A base class for creating Atmo. Atmospheric conditions and density calculations
Attributes:
Name | Type | Description |
---|---|---|
altitude |
Distance
|
Altitude relative to sea level |
pressure |
Pressure
|
Atmospheric pressure |
temperature |
Temperature
|
Atmospheric temperature |
humidity |
float
|
Atmospheric humidity |
powder_temp |
Temperature
|
Custom temperature of powder different to atmospheric. Uses together with Ammo.use_powder_sensitivity |
density_ratio |
float
|
Density ratio |
mach |
Velocity
|
Velocity instance that keeps velocity in mach 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 humidity in percents |
0.0
|
powder_t
|
Optional[Union[float, Temperature]]
|
Custom temperature of powder different to atmospheric. Uses together with Ammo.use_powder_sensitivity |
None
|
Example
This is how you can create an Atmo
from py_ballisticcalc import Atmo
wind = Wind(
altitude=Unit.Meter(100),
pressure=Unit.hPa(1000),
temperature=Unit.Celsius(20),
humidity=50,
powder_t=1.23
)
Source code in py_ballisticcalc\conditions.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 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 |
|
pressure
instance-attribute
¶
pressure: Pressure = pressure(pressure or standard_pressure(altitude))
temperature
instance-attribute
¶
temperature: Temperature = temperature(temperature or standard_temperature(altitude))
density_ratio
instance-attribute
¶
density_ratio: float = calculate_density(_t0, _p0) / cStandardDensity
standard_temperature
staticmethod
¶
standard_temperature(altitude: Distance) -> Temperature
Returns:
Type | Description |
---|---|
Temperature
|
ICAO standard temperature for altitude |
Source code in py_ballisticcalc\conditions.py
99 100 101 102 103 104 105 106 |
|
standard_pressure
staticmethod
¶
standard_pressure(altitude: Distance) -> Pressure
Returns:
Type | Description |
---|---|
Pressure
|
ICAO standard pressure for altitude |
Source code in py_ballisticcalc\conditions.py
108 109 110 111 112 113 114 115 116 117 |
|
standard
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
altitude
|
Union[float, Distance]
|
relative to sea level |
0
|
temperature
|
Optional[Temperature]
|
Temperature instance |
None
|
Returns: Atmo instance. Creates standard ICAO atmosphere at given altitude. If temperature not specified uses standard temperature.
Source code in py_ballisticcalc\conditions.py
123 124 125 126 127 128 129 130 131 132 133 |
|
icao
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
altitude
|
Union[float, Distance]
|
relative to sea level |
0
|
temperature
|
Optional[Temperature]
|
Temperature instance |
None
|
Returns: Atmo instance. Creates standard ICAO atmosphere at given altitude. If temperature not specified uses standard temperature.
Source code in py_ballisticcalc\conditions.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
machF
staticmethod
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fahrenheit
|
float
|
Fahrenheit temperature |
required |
Returns: Mach 1 in fps for Fahrenheit temperature
Source code in py_ballisticcalc\conditions.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
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
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
air_density
staticmethod
¶
Wiki: Density_of_air
Parameters:
Name | Type | Description | Default |
---|---|---|---|
t
|
Temperature
|
Temperature instance |
required |
p
|
Pressure
|
Pressure instance |
required |
humidity
|
float
|
Humidity instance |
required |
Returns:
Type | Description |
---|---|
float
|
Density in Imperial units (lb/ft^3) |
Source code in py_ballisticcalc\conditions.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
density_imperial
property
¶
density_imperial: float
Returns:
Type | Description |
---|---|
float
|
density in lb/ft^3 |
temperature_at_altitude ¶
Interpolated temperature at altitude Args: altitude: ASL in ft Returns: temperature in °F
Source code in py_ballisticcalc\conditions.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
calculate_density ¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
t
|
float
|
temperature in °F |
required |
p
|
float
|
pressure in inHg |
required |
Returns: density with specified atmosphere
Source code in py_ballisticcalc\conditions.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
get_density_factor_and_mach_for_altitude ¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
altitude
|
float
|
ASL in units of feet |
required |
Returns: density ratio and Mach 1 (fps) for the specified altitude
Source code in py_ballisticcalc\conditions.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
|