Skip to main content

A Python wrapper around the NRLMSIS model.

Project description

pymsis: A python wrapper of the NRLMSIS model

image

DOI PyPi Downloads GitHubActions codecov

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.

  1. Create a range of dates during the 2003 Halloween storm.
  2. Run the model at the desired location (lon, lat) (0, 0) and 400 km altitude.
  3. 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

DOI

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.

  1. 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.

  2. 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/
    
  3. Install the Python package

    pip install .
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymsis-0.8.0.tar.gz (113.9 kB view details)

Uploaded Source

Built Distributions

pymsis-0.8.0-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12 Windows x86-64

pymsis-0.8.0-cp312-cp312-musllinux_1_1_x86_64.whl (945.1 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pymsis-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pymsis-0.8.0-cp312-cp312-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pymsis-0.8.0-cp311-cp311-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.11 Windows x86-64

pymsis-0.8.0-cp311-cp311-musllinux_1_1_x86_64.whl (944.7 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pymsis-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pymsis-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pymsis-0.8.0-cp310-cp310-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.10 Windows x86-64

pymsis-0.8.0-cp310-cp310-musllinux_1_1_x86_64.whl (944.6 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pymsis-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pymsis-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pymsis-0.8.0-cp39-cp39-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.9 Windows x86-64

pymsis-0.8.0-cp39-cp39-musllinux_1_1_x86_64.whl (944.6 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pymsis-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pymsis-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file pymsis-0.8.0.tar.gz.

File metadata

  • Download URL: pymsis-0.8.0.tar.gz
  • Upload date:
  • Size: 113.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pymsis-0.8.0.tar.gz
Algorithm Hash digest
SHA256 fa4818eca6ab146e3ef25908f524d4ba83198ff6c3800a802f2d653f01201c67
MD5 6732bccd1f4d52e0768ef75f4ca0b9e2
BLAKE2b-256 bf65001d55c011d6413af04366c91001999794d6949fe153195c48d2245d49f7

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pymsis-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pymsis-0.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f46b06bdda18bfafc78b6177658018b49ae12c9a2b5033b266cabd565601ff98
MD5 30160238830e544a96f9843fd722de3d
BLAKE2b-256 389a7632049c25ea352ac9d875c669a3aa1ed1ebfdad26f548b9016592fdadab

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1722fadd56eff7c5c0c0d0ea7c7859518f4fcb6a0f70fa3a0943ccb56eaa4a33
MD5 f1a2bb16a2ac2ca77308073e089ee318
BLAKE2b-256 a71523deed7d7b52b9e46b0fd4390cbbe5f8aceb69a7c0f5099b7101bbe52ccc

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f857d546133e10938c8d81d975ec2c8b305bbe1d405c629d5132db1cbae6c5c
MD5 049fd8ab61aa5017fea3a212587ffcd6
BLAKE2b-256 db25955f5ccc702a4af1b260b63b22096960dc1cf4499d25b5d9c6ad1e638f74

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5a7720a4f3b073cf352fc8682e5bcd4f31ad69652f179f5e6ccd276f99b0c1c9
MD5 a44d290e9589a038c51ca300d5c12cb6
BLAKE2b-256 c01395f54033d08ff0a5b6623534ef2ea824c86bd513869d005ce50846de28c8

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pymsis-0.8.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pymsis-0.8.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9b85c1df12c1c6d6a17369fa350b29c4045d93c5f1cceb9e9c8a7cabcf98e508
MD5 f6a23cbcb95bcb3944eaef45525cb721
BLAKE2b-256 4428447cdd724368f1539c67c5887e842aea81b4f30da4f210ddb91a4615674d

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 969d982694b9bef0f7e9df4ff90e6bd6d040580dd328b57a4e869eba472e5176
MD5 be293c01a81437ffb2b2bed7a68a38c6
BLAKE2b-256 89bcd8fea62e52113253a8580bf71b04bb6ebef57120b1d10c156847a5def38a

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd9cb583b7a2d777468f5637b93a124cea49a1d4ed092058a0c93bccc9fa6d1c
MD5 502fbbd20a52a4cb7ae6d2cec274d242
BLAKE2b-256 d10e229f7432e147ec5ce54d45ffea60474a60eec18517297809172e6f282d64

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 22f436bfe8f384f4f0e7eb7f7e4349c279f660a291370759df7af86b99cfce1e
MD5 a017fa459bd3bc2ce68588940abff450
BLAKE2b-256 485d0af3b8244b1f283da031a6e79eca6412980d7ceadebbf67fef3b541ffeab

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pymsis-0.8.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pymsis-0.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c9d6f491efc9b10df11ca1dd342fb66b4be615c0be67cf499b1bce9d4ec5b5ed
MD5 6c60be59e5fa3e3a164428e40b1ea097
BLAKE2b-256 1413ca954cd6c1077f1cf872d30b34b2f286677cadbfcbc6d7d83795647f2ac7

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a8aaca36dfd9f8dbc445610efedaf65f1ff61fdb2cc78ffde2952f7b85442f3e
MD5 9627d473f792d37ebd8a562705fdd2ee
BLAKE2b-256 212b7451b6f1bc30c1bf3cdf8315f98acd689c632eb6efa836ac03ac6d948e62

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cfedaa5388198cf6eb2e922c9a19f5d5068f518feb09b7ee5818e83d47c67f8
MD5 c10319dcd5747259aef6a982fb3c1247
BLAKE2b-256 70e15942b74f4ec1ba438b67733745ddcf9c9bfdd5fe7d61a8dbd18dcc0ff0ac

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e74a0fc9d9ba1202024432f08cc19128647200b7beec556a671e440b642f9cf9
MD5 bc9fb43fc36e21f476961ac049288534
BLAKE2b-256 436ef4fa5492b1c47c7336b6b60d17e748ee415b6e90590467533e232fda69e8

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pymsis-0.8.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pymsis-0.8.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ebb1a05dc7c8245f897ea4daf54e1aeb37d3ca6bcd0886c20d803b4e25346e7f
MD5 0b2da9322b551dceaf34de882d3202e3
BLAKE2b-256 5fc4361337ead94c4d69a5d7796b7b6e665cd501171a1bd88cae62605c8534fc

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2af5754cb6f2247a26408fb9d926d8df5d07abdeff3108e88ed9f3034679237c
MD5 19b77c77cfaff106a4d276b876e1a553
BLAKE2b-256 0eea314ed8069276ddd0fa56c07b3f5c6f6e8aea4106b5a9ecc0f06b09eb7258

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9bd3fa68a13be89ab17bd9c9a91b6054ea25d5704af54029723ad48ffd08d71
MD5 ed1745c2e788faa240fc2208fb3e14d8
BLAKE2b-256 e1ff900141ad64037e551a71c73cdaf8a1b801d762c24fdee04d5b5501d796d0

See more details on using hashes here.

File details

Details for the file pymsis-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d990625b16ea95763e2653f0101f236a8f951610822d0284aa7cb3e854529f6c
MD5 8abc0d35bd81253df807952b4f5334a0
BLAKE2b-256 4efd7bbfe9b4ab8ab207bd9a25dfe3e1e4a26a79fb40eebb1eb30a9fc49f98b1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page