A Python wrapper around the NRLMSIS model.
Project description
pymsis: A python wrapper of the NRLMSIS model
Pymsis is a minimal and fast Python wrapper of the NRLMSIS models (MSISE-00, MSIS2.0, MSIS2.1).
Quickstart
Web viewer: An interactive website using pymsis through cloud-based serverless functions. Project homepage: Location for all documentation. API Reference: Details about the various options and configurations available in the functions. Examples: Demo for how to access and plot the data.
A few short lines of code to get started quickly with pymsis.
- Create a range of dates during the 2003 Halloween storm.
- Run the model at the desired location (lon, lat) (0, 0) and 400 km altitude.
- Plot the results to see how the mass density increased at 400 km altitude during this storm.
import numpy as np
from pymsis import msis
dates = np.arange(np.datetime64("2003-10-28T00:00"), np.datetime64("2003-11-04T00:00"), np.timedelta64(30, "m"))
# geomagnetic_activity=-1 is a storm-time run
data = msis.run(dates, 0, 0, 400, geomagnetic_activity=-1)
# Plot the data
import matplotlib.pyplot as plt
# Total mass density over time
plt.plot(dates, data[:, 0, 0, 0, 0])
plt.show()
note
- The model will automatically download and access the F10.7 and ap data for you if you have an internet connection.
- The returned data structure has shape [ndates, nlons, nlats, nalts, 11], but for this example we only have one point with many dates [ndates, 1, 1, 1, 11].
- The 11 is for each of the species MSIS calculates for each input point. The first element is the Total Mass Density (kg/m3).
NRL Mass Spectrometer, Incoherent Scatter Radar Extended Model (MSIS)
The MSIS model is developed by the Naval Research Laboratory.
Note that the MSIS2 code is not available for commercial use without contacting NRL. See the MSIS2 license file for explicit details. We do not repackage the MSIS source code in this repository for that reason. However, we do provide utilities to easily download and extract the original source code. By using that code you agree to their terms and conditions.
References
Please acknowledge the University of Colorado Space Weather Technology, Research and Education Center (SWx TREC) and cite the original papers if you make use of this model in a publication.
Python Code
Lucas, G. (2022). pymsis [Computer software]. doi:10.5281/zenodo.5348502
MSIS2.1
Emmert, J. T., Jones, M., Siskind, D. E., Drob, D. P., Picone, J. M., Stevens, M. H., et al. (2022). NRLMSIS 2.1: An empirical model of nitric oxide incorporated into MSIS. Journal of Geophysical Research: Space Physics, 127, e2022JA030896. doi:10.1029/2022JA030896
MSIS2.0
Emmert, J. T., Drob, D. P., Picone, J. M., Siskind, D. E., Jones, M., Mlynczak, M. G., et al. (2020). NRLMSIS 2.0: A whole‐atmosphere empirical model of temperature and neutral species densities. Earth and Space Science, 7, e2020EA001321. doi:10.1029/2020EA001321
MSISE-00
Picone, J. M., Hedin, A. E., Drob, D. P., and Aikin, A. C., NRLMSISE‐00 empirical model of the atmosphere: Statistical comparisons and scientific issues, J. Geophys. Res., 107( A12), 1468, doi:10.1029/2002JA009430, 2002.
Geomagnetic Data
If you make use of the automatic downloads of the F10.7 and ap data, please cite that data in your publication as well. The data is downloaded from CelesTrak, which has filled in missing data from the source. Both citations are given below.
CelesTrak. https://celestrak.org/SpaceData/
Matzka, J., Stolle, C., Yamazaki, Y., Bronkalla, O. and Morschhauser, A., 2021. The geomagnetic Kp index and derived indices of geomagnetic activity. Space Weather, doi:10.1029/2020SW002641.
Installation
The easiest way to install pymsis is to install from PyPI.
pip install pymsis
For the most up-to-date pymsis, you can install directly from the git repository
pip install git+https://github.com/SWxTREC/pymsis.git
or to work on it locally, you can clone the repository and install the test dependencies.
git clone https://github.com/SWxTREC/pymsis.git
cd pymsis
pip install .[tests]
Remote installation
The installation is dependent on access to the NRL source code. If the download fails, or you have no internet access you can manually install the Fortran source code as follows. A script to help with this or give ideas on how to achieve this remote installation are provided in the tools directory.
-
Download the source code The source code is hosted on NRL's website: https://map.nrl.navy.mil/map/pub/nrl/NRLMSIS/NRLMSIS2.0/ Download the
NRLMSIS2.0.tar.gz
file to your local system. -
Extract the source files The tar file needs to be extracted to the
src/msis2.0
directory.tar -xvzf NRLMSIS2.0.tar.gz -C src/msis2.0/
-
Install the Python package
pip install .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pymsis-0.9.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 987.5 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c10aacff2d6ad88ba807d4890a6141cac3af19d1213a4d32f55bf5470cbabf15 |
|
MD5 | 4d0e70b0d489e3a029a165653d543a6d |
|
BLAKE2b-256 | f40bbfd9321f8bba44cd25ef70b316aea040238f7e8b0d2156ed242a2398277d |
File details
Details for the file pymsis-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 946.9 kB
- Tags: CPython 3.12, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f3fb2c612a8d4d65dd84217047854c26a829a1b934395c1b258bf708667ca73 |
|
MD5 | 7831272b2ec54c0bb62ad437a8f7c906 |
|
BLAKE2b-256 | e5ace44af55ebca586f7aa4a94dd54da587a5e9ba7f7239271a2e3374712a4f5 |
File details
Details for the file pymsis-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2291f17a0cb6f8361f54131822fe917e89ec4eea7f1d2f666c4f867aaab9ba |
|
MD5 | 78c5c66195ef431b34351ea87599750f |
|
BLAKE2b-256 | b9433bf3625a88bf285a28e921e8a4ef45e9005ac9114c095b041de7b2c3dc00 |
File details
Details for the file pymsis-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 970.5 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7570c88f37d34e176036c83f0e8251a82d4a0e01ff44c372539139f0326079ce |
|
MD5 | 3de7c15657e9f2dd5dce2a7220164a76 |
|
BLAKE2b-256 | 131013ae55893c1368897268974cb035d7d04e678806e9d2a8e26da37fc605d3 |
File details
Details for the file pymsis-0.9.0-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17eddbffd58637803cb04667221df7dded595683018725d8095da9cba9de4a9b |
|
MD5 | b173322b8ecc8299d93b59b0190b07d3 |
|
BLAKE2b-256 | 65e8c0ce6fe0347ba9a824ff24f78d0d310aff8c64d44925958a65a761df2067 |
File details
Details for the file pymsis-0.9.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 986.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d513de884e70356e3cef3cbee2481537210e5dc2257dea2e2eb475648293da91 |
|
MD5 | 7ef4fdb284568eb7b1cd4f7374361942 |
|
BLAKE2b-256 | cb9783a0ffb014353ba048fdfce86fb23488172838c8428f90323d7ed6f2f602 |
File details
Details for the file pymsis-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 946.4 kB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44272e418913bc82c5bb3855cefe55837c0a070a82af2a57614ba63939a4a9b5 |
|
MD5 | fcb2601f7d957145e7358e58af3b3ce8 |
|
BLAKE2b-256 | bc3aedfa400eb9819096927e15518ebc700702ef7d4ed58def111e7a4bb02f9f |
File details
Details for the file pymsis-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f894287bb2c371876a5cf4bf03021100994fc3324fc6cc891edfe1190a895104 |
|
MD5 | 413cabea4acfe953710d728df0a2843e |
|
BLAKE2b-256 | a6b8cf0724d8e8a87ce90a76acddbac0ba884b95d7e30448f238f0fe78421453 |
File details
Details for the file pymsis-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 970.1 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a51c6e92a9a6258baa1a57d0abfcddcc923706dd1493b27118ff494394add59a |
|
MD5 | 472d43ce30251b5256a66519d8687e1d |
|
BLAKE2b-256 | 8c3027dad25c32782af60c31c7ebb997a01a6def65aef7d52d701a4b633b4bf6 |
File details
Details for the file pymsis-0.9.0-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0be13be2660aec78871465548002ace41944c4cdb420a73d0c6e0ab129ba52d7 |
|
MD5 | 65bbf048ed8cb102add26cc75d6b74b8 |
|
BLAKE2b-256 | 7d3599f7b7ece329d918089eaea17a931dd9b2cb11e9fd23a8c1f50390eda921 |
File details
Details for the file pymsis-0.9.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 986.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523557cb532a3ac32064ff00f75d00dd31a6d45a68ef3926dce1e733a510cc46 |
|
MD5 | b17b0a3440bd8bde2d780f66e71a92c7 |
|
BLAKE2b-256 | 7c27e3285ffea30d499abd7947dc6aaf12a53f0284be325ecd3deb839465719d |
File details
Details for the file pymsis-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 946.3 kB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d8d9ecbe38d719d10c5f31baa13d6a0a21004c5bc2604d60f7411d760160f3f |
|
MD5 | e475e4b52b1124619de4dce28d8aa071 |
|
BLAKE2b-256 | 7324fb43df1cb67f3c611802716569e45521b09a28a16fd07f82bcb7c76dbf40 |
File details
Details for the file pymsis-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9825e82635e44f6715f7ecc7bc7dd64db1d118d22ad2cf90b0078926d082c6fb |
|
MD5 | bf559d4d7acbccee525747142126d002 |
|
BLAKE2b-256 | 8dd5c9e046e013ad89da915aefe6e44e4187b84c040f8da96f3740a9569ac47b |
File details
Details for the file pymsis-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 970.1 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 791e64584ca9ac6690ee30638340c85436047600dcbdd744105912af6a55f762 |
|
MD5 | 433a0a6374e2a7ab494de08c8f5977aa |
|
BLAKE2b-256 | 7a62bd62c330ffd68bdb1ee573aa94c886bed698b8cfbf33e13ff3bf481a60f7 |
File details
Details for the file pymsis-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymsis-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fdff059154345761699fcab7883f3a2e7eeb0a7b18bae6d69ab651e03013baa |
|
MD5 | 4bf72a8c5b567e050aa326448fb48aad |
|
BLAKE2b-256 | 6165a7df3b9a60f0fe49fba734c41bfd83329d8a3c2427a7fff9f6559b49d63d |