Air thermo
air_density
air_density(t, p, rh)
Moist air density given temperature, pressure, and relative humidity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Moist air density in kg/m^3 |
Source code in src/pytoast/utils/air_thermo.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
dry_adiabatic_lapse_rate
dry_adiabatic_lapse_rate(t, g_lat=GRAVITATIONAL_ACCELERATION)
Adiabatic lapse rate of dry air.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
g_lat
|
Numeric
|
Gravitational acceleration in m/s^2. Defaults to 9.81 if not provided |
GRAVITATIONAL_ACCELERATION
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Lapse rate in K / m |
Source code in src/pytoast/utils/air_thermo.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
dry_air_density
dry_air_density(t, p)
Dry air density given temperature and pressure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Dry air density in kg/m^3 |
Source code in src/pytoast/utils/air_thermo.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
kinematic_viscosity
kinematic_viscosity(t)
Kinematic viscosity of air.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Kinematic viscosity in m^2/s |
Source code in src/pytoast/utils/air_thermo.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
latent_heat_of_vaporization
latent_heat_of_vaporization(t)
Latent heat of vaporization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Latent heat of vaporization in J/kg |
Source code in src/pytoast/utils/air_thermo.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
mixing_ratio
mixing_ratio(t, p, rh, sp=None)
Water vapor mixing ratio given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Mixing ratio in kg/kg |
Source code in src/pytoast/utils/air_thermo.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
p_mbar2pa
p_mbar2pa(p)
Convert pressure from millibar to Pascal.
Source code in src/pytoast/utils/air_thermo.py
33 34 35 | |
potential_temperature
potential_temperature(t, z)
Potential temperature, i.e. the temperature an air parcel would have if brought adiabatically to a reference level at the surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
z
|
Numeric
|
Height above the surface in meters. |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Potential temperature in Celcius |
Source code in src/pytoast/utils/air_thermo.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
relative_humidity_from_specific_humidity
relative_humidity_from_specific_humidity(t, p, q, t_freeze=None)
Relative humidity (%) given temperature, pressure, specific humidity, and (optionally) freezing temperature
t : Numeric Air temperature in Celcius p : Numeric Atmospheric pressure in millibar q : Numeric Specific humidity in kg/kg t_freeze: Numeric, optional If specific, the saturation vapor pressure is corrected to account for ice conditions
Returns:
| Type | Description |
|---|---|
Numeric
|
Relative humidity in % |
Source code in src/pytoast/utils/air_thermo.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
saturation_specific_humidity
saturation_specific_humidity(t, p, sp=None, t_freeze=None)
Specific humidity given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
t_freeze
|
Numeric | None
|
If specific, the saturation vapor pressure is corrected to account for ice conditions |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Specific humidity in kg/kg |
Source code in src/pytoast/utils/air_thermo.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
saturation_vapor_pressure
saturation_vapor_pressure(t, p, sp=None, t_freeze=None)
Saturation vapor pressure given pressure, temperature, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
t_freeze
|
Numeric | None
|
If specified, the saturation vapor pressure is corrected to account for ice conditions |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Saturation vapor pressure in millibar |
Source code in src/pytoast/utils/air_thermo.py
38 39 40 41 42 43 44 45 46 47 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 | |
specific_heat
specific_heat(t)
Specific heat capacity of air at constant pressure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
Returns:
| Type | Description |
|---|---|
Numeric
|
Specific heat capacity in J/(kg K) |
Source code in src/pytoast/utils/air_thermo.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
specific_humidity
specific_humidity(t, p, rh, sp=None)
Specific humidity given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Specific humidity in kg/kg |
Source code in src/pytoast/utils/air_thermo.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
t_c2kelvin
t_c2kelvin(t)
Convert temperature from Celsius to Kelvin.
Source code in src/pytoast/utils/air_thermo.py
28 29 30 | |
virtual_temperature
virtual_temperature(t, p, rh, sp=None)
Virtual temperature given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Virtual temperature in Celcius |
Source code in src/pytoast/utils/air_thermo.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
water_vapor_density
water_vapor_density(t, p, rh, sp=None)
Water vapor density given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Water vapor density in kg/m^3 |
Source code in src/pytoast/utils/air_thermo.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
water_vapor_pressure
water_vapor_pressure(t, p, rh, sp=None)
Water vapor pressure given temperature, pressure, relative humidity, and (optionally) seawater salinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Numeric
|
Air temperature in Celcius |
required |
p
|
Numeric
|
Atmospheric pressure in millibar |
required |
rh
|
Numeric
|
Relative humidity in % |
required |
sp
|
Numeric
|
If specified, the saturation vapor pressure is corrected to its "above seawater" value using salinity in PSU |
None
|
Returns:
| Type | Description |
|---|---|
Numeric
|
Water vapor pressure in millibar |
Source code in src/pytoast/utils/air_thermo.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |