# Atmospheric properties (fluids.atmosphere)¶

class fluids.atmosphere.ATMOSPHERE_1976(Z, dT=0)[source]

Bases: object

US Standard Atmosphere 1976 class, which calculates T, P, rho, v_sonic, mu, k, and g as a function of altitude above sea level. Designed to provide reasonable results up to an elevation of 86,000 m (0.4 Pa). The model is also valid under sea level, to -610 meters.

Parameters: Z : float Elevation, [m] dT : float, optional Temperature difference from standard conditions used in determining the properties of the atmosphere, [K]

Notes

Up to 32 km, the International Standard Atmosphere (ISA) and World Meteorological Organization (WMO) standard atmosphere are identical.

This is a revision of the US 1962 atmosphere.

References

 [R110] NOAA, NASA, and USAF. “U.S. Standard Atmosphere, 1976” October 15, 1976. http://ntrs.nasa.gov/search.jsp?R=19770009539.
 [R210] “ISO 2533:1975 - Standard Atmosphere.” ISO. http://www.iso.org/iso/catalogue_detail.htm?csnumber=7472.
 [R310] Yager, Robert J. “Calculating Atmospheric Conditions (Temperature, Pressure, Air Density, and Speed of Sound) Using C++,” June 2013. http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA588839

Examples

>>> five_km = ATMOSPHERE_1976(5000)
>>> five_km.P, five_km.rho, five_km.mu
(54048.28614576141, 0.7364284207799743, 1.628248135362207e-05)
>>> five_km.k, five_km.g, five_km.v_sonic
(0.02273190295142526, 9.791241076982665, 320.5455196704035)


Methods

R = 8314.32
static density(T, P)[source]

Method defined in the US Standard Atmosphere 1976 for calculating density of air as a function of T and P. MW is defined as 28.9644 g/mol, and R as 8314.32 J/kmol/K

$\rho_g = \frac{P\cdot MW}{T\cdot R\cdot 1000}$
Parameters: T : float Temperature, [K] P : float Pressure, [Pa] rho : float Mass density, [kg/m^3]
static gravity(Z)[source]

Method defined in the US Standard Atmosphere 1976 for calculating the gravitational acceleration above earth as a function of elevation only.

$g = g_0\left(\frac{r_0}{r_0+Z}\right)^2$
Parameters: Z : float Elevation above sea level, [m] g : float Acceleration due to gravity, [m/s^2]
static sonic_velocity(T)[source]

Method defined in the US Standard Atmosphere 1976 for calculating the speed of sound in air as a function of T only.

$c = \left(\frac{\gamma R T}{MW}\right)^{0.5}$
Parameters: T : float Temperature, [K] c : float Speed of sound, [m/s]
static thermal_conductivity(T)[source]

Method defined in the US Standard Atmosphere 1976 for calculating thermal conductivity of air as a function of T only.

$k_g = \frac{2.64638\times10^{-3}T^{1.5}} {T + 245.4\cdot 10^{-12./T}}$
Parameters: T : float Temperature, [K] kg : float Thermal conductivity, [W/m/K]
static viscosity(T)[source]

Method defined in the US Standard Atmosphere 1976 for calculating viscosity of air as a function of T only.

$\mu_g = \frac{1.458\times10^{-6}T^{1.5}}{T+110.4}$
Parameters: T : float Temperature, [K] mug : float Viscosity, [Pa*s]
class fluids.atmosphere.ATMOSPHERE_NRLMSISE00(Z, latitude=0, longitude=0, day=0, seconds=0, f107=150.0, f107_avg=150.0, geomagnetic_disturbance_indices=None)[source]

Bases: object

NRLMSISE 00 model for calculating temperature and density of gases in the atmosphere, from ground level to 1000 km, as a function of time of year, longitude and latitude, solar activity and earth’s geomagnetic disturbance.

NRLMSISE stands for the US Naval Research Laboratory Mass Spectrometer and Incoherent Scatter Radar Exosphere model, released in 2001; see [R413] for details.

Parameters: Z : float Elevation, [m] latitude : float, optional Latitude, between -90 and 90 [degrees] longitude : float, optional Longitude, between -180 and 180 or 0 and 360, [degrees] day : float, optional Day of year, 0-366 [day] seconds : float, optional Seconds since start of day, in UT1 time; using UTC provides no loss in accuracy [s] f107 : float, optional Daily average 10.7 cm solar flux measurement of the strength of solar emissions on the 100 MHz band centered on 2800 MHz, averaged hourly; in sfu units, which are multiples of 10^-22 W/m^2/Hz; use 150 as a default [sfu] f107_avg : float, optional 81-day sfu average; centered on specified day if possible, otherwise use the previous days [sfu] geomagnetic_disturbance_indices : list[float], optional List of the 7 following Ap indexes also known as planetary magnetic indexes. Has a negligible effect on the calculation. 4 is the default value often used for each of these values. Average daily Ap. 3-hour average Ap centered on the current time. 3-hour average Ap before the current time. 6-hour average Ap before the current time. 9-hour average Ap before the current time. Average Ap from 12 to 33 hours before the current time, based on eight 3-hour average Ap values. Average Ap from 36 to 57 hours before the current time, based on eight 3-hour average Ap values.

Notes

No full description has been published of this model; it has been defined by its implementation only. It was written in FORTRAN, and is accessible at ftp://hanna.ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/msis/nrlmsise00/

A C port of the model by Dominik Brodowskihas become popular, and is available on his website: http://www.brodo.de/space/nrlmsise/.

In 2013 Joshua Milas ported the C port to Python. This is an interface to his excellent port. It is a 1000-sloc model, and has been rigorously tested against the C version, and the online calculation tool available at [R613] for parametric inputs of latitude, longitude, altitude, time of day and day of year.

This model is based on measurements other than gravity; it does not provide a calculation method for g. It does not provide transport properties.

References

 [R413] (1, 2, 3) Picone, J. M., A. E. Hedin, D. P. Drob, and A. C. Aikin. “NRLMSISE-00 Empirical Model of the Atmosphere: Statistical Comparisons and Scientific Issues.” Journal of Geophysical Research: Space Physics 107, no. A12 (December 1, 2002): 1468. doi:10.1029/2002JA009430.
 [R513] Tapping, K. F. “The 10.7 Cm Solar Radio Flux (F10.7).” Space Weather 11, no. 7 (July 1, 2013): 394-406. doi:10.1002/swe.20064.
 [R613] (1, 2) Natalia Papitashvili. “NRLMSISE-00 Atmosphere Model.” Accessed November 27, 2016. http://ccmc.gsfc.nasa.gov/modelweb/models/nrlmsise00.php.

Examples

>>> atmosphere = ATMOSPHERE_NRLMSISE00(1E3, 45, 45, 150)
>>> atmosphere.T, atmosphere.rho
(285.54408606237405, 1.1019062026405517)


Attributes

 rho (float) Mass density [kg/m^3] T (float) Temperature, [K] P (float) Pressure, calculated with ideal gas law [P] He_density (float) Density of helium atoms [count/m^3] O_density (float) Density of monatomic oxygen [count/m^3] N2_density (float) Density of nitrogen molecules [count/m^3] O2_density (float) Density of oxygen molecules [count/m^3] Ar_density (float) Density of Argon atoms [count/m^3] H_density (float) Density of hydrogen atoms [count/m^3] N_density (float) Density of monatomic nitrogen [count/m^3] O_anomalous_density (float) Density of anomalous oxygen; see [R413] for details [count/m^3] particle_density (float) Total density of molecules [count/m^3] components (list[str]) List of species making up the atmosphere [-] zs (list[float]) Mole fractions of each molecule in the atmosphere, in order of components [-]
MWs = [28.0134, 31.9988, 39.948, 4.002602, 15.9994, 1.00794, 14.0067]
atrrs = ['N2_density', 'O2_density', 'Ar_density', 'He_density', 'O_density', 'H_density', 'N_density']
components = ['N2', 'O2', 'Ar', 'He', 'O', 'H', 'N']
fluids.atmosphere.hwm93(Z, latitude=0, longitude=0, day=0, seconds=0, f107=150.0, f107_avg=150.0, geomagnetic_disturbance_index=4)[source]

Horizontal Wind Model 1993, for calculating wind velocity in the atmosphere as a function of time of year, longitude and latitude, solar activity and earth’s geomagnetic disturbance.

The model is described across the publications [R716], [R816], and [R916].

Parameters: Z : float Elevation, [m] latitude : float, optional Latitude, between -90 and 90 [degrees] longitude : float, optional Longitude, between -180 and 180 or 0 and 360, [degrees] day : float, optional Day of year, 0-366 [day] seconds : float, optional Seconds since start of day, in UT1 time; using UTC provides no loss in accuracy [s] f107 : float, optional Daily average 10.7 cm solar flux measurement of the strength of solar emissions on the 100 MHz band centered on 2800 MHz, averaged hourly; in sfu units, which are multiples of 10^-22 W/m^2/Hz; use 150 as a default [W/m^2/Hz] f107_avg : float, optional 81-day sfu average; centered on specified day if possible, otherwise use the previous days [W/m^2/Hz] geomagnetic_disturbance_index : float, optional Average daily Ap or also known as planetary magnetic index. v_north : float Wind velocity, meridional (Northward) [m/s] v_east : float Wind velocity, zonal (Eastward) [m/s]

Notes

No full description has been published of this model; it has been defined by its implementation only. It was written in FORTRAN, and is accessible at ftp://hanna.ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/hwm93/.

F2PY auto-compilation support is not yet currently supported. To compile this file, run the following command in a shell after navigating to $FLUIDSPATH/fluids/optional/. This should generate the file hwm93.so in that directory. f2py -c hwm93.pyf hwm93.for –f77flags=”-std=legacy” If the module is not compiled, an import error will be raised. References  [R716] (1, 2) Hedin, A. E., N. W. Spencer, and T. L. Killeen. “Empirical Global Model of Upper Thermosphere Winds Based on Atmosphere and Dynamics Explorer Satellite Data.” Journal of Geophysical Research: Space Physics 93, no. A9 (September 1, 1988): 9959-78. doi:10.1029/JA093iA09p09959.  [R816] (1, 2) Hedin, A. E., M. A. Biondi, R. G. Burnside, G. Hernandez, R. M. Johnson, T. L. Killeen, C. Mazaudier, et al. “Revised Global Model of Thermosphere Winds Using Satellite and Ground-Based Observations.” Journal of Geophysical Research: Space Physics 96, no. A5 (May 1, 1991): 7657-88. doi:10.1029/91JA00251.  [R916] (1, 2) Hedin, A. E., E. L. Fleming, A. H. Manson, F. J. Schmidlin, S. K. Avery, R. R. Clark, S. J. Franke, et al. “Empirical Wind Model for the Upper, Middle and Lower Atmosphere.” Journal of Atmospheric and Terrestrial Physics 58, no. 13 (September 1996): 1421-47. doi:10.1016/0021-9169(95)00122-0. Examples >>> hwm93(5E5, 45, 50, 365) (-73.00312042236328, 0.1485661268234253)  fluids.atmosphere.hwm14(Z, latitude=0, longitude=0, day=0, seconds=0, geomagnetic_disturbance_index=4)[source] Horizontal Wind Model 2014, for calculating wind velocity in the atmosphere as a function of time of year, longitude and latitude, and earth’s geomagnetic disturbance. The model is described in [R1019]. The model no longer accounts for solar flux. Parameters: Z : float Elevation, [m] latitude : float, optional Latitude, between -90 and 90 [degrees] longitude : float, optional Longitude, between -180 and 180 or 0 and 360, [degrees] day : float, optional Day of year, 0-366 [day] seconds : float, optional Seconds since start of day, in UT1 time; using UTC provides no loss in accuracy [s] geomagnetic_disturbance_index : float, optional Average daily Ap or also known as planetary magnetic index. v_north : float Wind velocity, meridional (Northward) [m/s] v_east : float Wind velocity, zonal (Eastward) [m/s] Notes No full description has been published of this model; it has been defined by its implementation only. It was written in FORTRAN, and is accessible at http://onlinelibrary.wiley.com/store/10.1002/2014EA000089/asset/supinfo/ess224-sup-0002-supinfo.tgz?v=1&s=2a957ba70b7cf9dd0612d9430076297c3634ea75. F2PY auto-compilation support is not yet currently supported. To compile this file, run the following command in a shell after navigating to$FLUIDSPATH/fluids/optional/. This should generate the file hwm14.so in that directory.

f2py -c hwm14.pyf hwm14.f90

The fortran .pyf signature file is included with this project, but it can also be re-created with the command:

f2py -m hwm14 -h hwm14.pyf hwm14.f90

If the module is not compiled, an import error will be raised.

No patches were necessary to either the generated pyf or hwm14.f90 file, as the authors of [R1019] have made it F2PY compatible.

Developed using 73 million data points taken by 44 instruments over 60 years.

References

 [R1019] (1, 2, 3) Drob, Douglas P., John T. Emmert, John W. Meriwether, Jonathan J. Makela, Eelco Doornbos, Mark Conde, Gonzalo Hernandez, et al. “An Update to the Horizontal Wind Model (HWM): The Quiet Time Thermosphere.” Earth and Space Science 2, no. 7 (July 1, 2015): 2014EA000089. doi:10.1002/2014EA000089.

Examples

>>> hwm14(5E5, 45, 50, 365)
(-38.64341354370117, 12.871272087097168)