Package: pyatmos
Welcome to ATMOSThis package is an archive of scientific routines that estimates the vertical structure of atmosphere with variousatmospheric density models, such asExponential(-0.611~1000 km),COESA76(-0.611~1000 km),NRLMSISE-00(0~2000 km), andJB2008(90~2500 km).TheNRLMSISE-00model was developed by the US Naval Research Laboratory. It is based on mass spectrometry and incoherent radar scatter data, also incorporates drag and accelerometer data, and accounts for anomalous oxygen at high altitudes(>500 km). It is recommended by the International Committee on Space Resarch (COSPAR) as the standard for atmospheric composition. Two indices are used in this model:F10.7(both the daily solar flux value of the previous day and the 81-day average centred on the input day) and $A_p$ (geomagnetic daily value).TheJB2008(Jacchia-Bowman) model is a newer model developed by Space Environment Technologies(SET) and the US Air Force Space Command. The model accounts for various phenomena related to EUV heating of the thermosphere and uses the DST index as the driver of global density changes. The model is complementary to the NRLMSISE00 model and is more accurate during times of high solar activity and geomagnetic storms. It is recommended by COSPAR as the standard for thermospheric density in satellite drag calculations. Four solar indices and two geomagnetic activity indices are used in this model:F10.7(both tabular value one day earlier and the 81-day average centred on the input time);S10.7(both tabular value one day earlier and the 81-day average centred on the input time);M10.7(both tabular value five days earlier and the 81-day average centred on the input time); Y10.7 (both tabular value five days earlier and the 81-day average centred on the input time); $a_p$ (3 hour tabular value); andDST(converted and input as a dTc temperature change tabular value on the input time).TheExponentialreturnsthe mass densityTheCOESA76returnsthe mass density,  temperature, and pressure at the altitudeTheNRLMSISE-00returnsthe number densities of atmospheric constituents including N$_2$, O$_2$, Ar, He, O, N, and anomalous oxygen at altitude above 500 kmthe temperature at the altitudethe total mass density including the anomalous oxygen componentTheJB2008returnsthe temperature at the altitudethe total mass densityHow to installOn Linux, macOS and Windows architectures, the binary wheels can be installed usingpipby executing one of the following commands:pipinstallpyatmos
pipinstallpyatmos--upgrade# to upgrade a pre-existing installationHow to useExponential>>>frompyatmosimportexpo>>>expo_geom=expo([0,20,40,60,80])# geometric altitudes by default>>>print(expo_geom.rho)# [kg/m^3]>>># expo_geop = expo([0,20,40,60,80],'geopotential') # geopotential altitudes[1.22500000e+007.76098911e-023.97200000e-033.20600000e-041.90500000e-05]COESA 1976>>>frompyatmosimportcoesa76>>>coesa76_geom=coesa76([0,20,40,60,80])# geometric altitudes by default>>>print(coesa76_geom.rho)# [kg/m^3]>>>print(coesa76_geom.T)# [K]>>>print(coesa76_geom.P)# [Pa]>>># coesa76_geop = coesa76([0,20,40,60,80],'geopotential') # geopotential altitudes[1.22499916e+008.89079563e-023.99535051e-033.09628985e-041.84514759e-05][288.15216.65250.35120115247.01740767198.63418825][1.01325000e+055.52919008e+032.87122194e+022.19548951e+011.05207648e+00]NRLMSISE-00Before using NRLMSISE-00, the space weather data needs to be prepared in advance.>>>frompyatmosimportdownload_sw_nrlmsise00,read_sw_nrlmsise00>>># Download or update the space weather file from www.celestrak.com>>>swfile=download_sw_nrlmsise00()>>># Read the space weather data>>>swdata=read_sw_nrlmsise00(swfile)>>>frompyatmosimportnrlmsise00>>># Set a specific time and location>>>t='2014-07-22 22:18:45'# time(UTC)>>>lat,lon,alt=25,102,600# latitude, longitude in [degree], and altitude in [km]>>>nrl00=nrlmsise00(t,(lat,lon,alt),swdata)>>>print(nrl00.rho)# [kg/m^3]>>>print(nrl00.T)# [K]>>>print(nrl00.nd)# composition in [1/m^3]1.714115212984513e-14765.8976564552341{'He':645851224907.2849,'O':456706971423.5056,'N2':531545420.00015724,'O2':2681352.1654067687,'Ar':406.9308900607773,'H':157249711103.90558,'N':6759664327.87355,'ANM O':10526544596.059282}JB2008Before using JB2008, the space weather data needs to be prepared in advance.>>>frompyatmosimportdownload_sw_jb2008,read_sw_jb2008>>># Download or update the space weather file from https://sol.spacenvironment.net>>>swfile=download_sw_jb2008()>>># Read the space weather data>>>swdata=read_sw_jb2008(swfile)>>>frompyatmosimportjb2008>>># Set a specific time and location>>>t='2014-07-22 22:18:45'# time(UTC)>>>lat,lon,alt=25,102,600# latitude, longitude in [degree], and altitude in [km]>>>jb08=jb2008(t,(lat,lon,alt),swdata)>>>print(jb08.rho)# [kg/m^3]>>>print(jb08.T)# [K]1.2991711750265394e-14754.2803276187265Change log1.2.4 — Feb 16, 2023Changed functionsread_sw_nrlmsise00andget_swdue to the space weather file changed from 'SW-ALL.txt' to 'SW-ALL.csv'Deleted the colored-progress bar for downloading space weather file, and usewgetinstead.1.2.3 — Jun 7, 2021Added atmospheric modelsJB2008Changed the output of the result to an instanceImproved the code structure for NRLMSISE-00, and the running speed is nearly threefold1.2.1 — Jan 22, 2021AddedExponential Atmosphereup to 1000 kmAddedCommittee on Extension to the Standard Atmosphere(COESA)up to 1000 kmCompleted part of the help documentation for NRLMSISE-00Improved the code structure to make it easier to read1.1.2 — Jul 26, 2020Added colored-progress bar for downloading data1.1.0 — Mar 29,  2020Added the International Standard Atmosphere(ISA) Model up to 86kmsNext releaseBecause there is a45-day lagbetween the current Day-Of-Year and the last data DOY in the indices files provided by Space Environment Technologies(SET), the forecasts through the last data DOY out to 137 days (5 solar rotations) need to be estimated using machine learning or other methods.Add other atmospheric models, such as theEarth Global Reference Atmospheric Model(Earth-GRAM) 2016, and theDrag Temperature Model(DTM)2013.ReferenceU.S. Standard Atmosphere, 1976, U.S. Government Printing Office, Washington, D.C.Public Domain Aeronautical Softwarehttps://gist.github.com/buzzerrookie/5b6438c603eabf13d07ehttps://ww2.mathworks.cn/help/aerotbx/ug/atmosisa.htmlOriginal Fortran and C codeMSISE-00 in Python and MatlabNRLMSISE-00 Atmosphere Model - MatlabNRLMSISE-00 Atmosphere Model - Aerospace BlocksetNRLMSISE-00 Atmosphere Model - CCMCNRLMSISE-00 empirical model of the atmosphere: Statistical comparisons and scientific issuesATMOSPHERIC MODELSpoliastro-Atmosphere moduleATMOSPHERE APICOSPAR International Reference Atmosphere - 2012