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.7.0.tar.gz (112.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 Windows x86-64

pymsis-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pymsis-0.7.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

pymsis-0.7.0-cp311-cp311-macosx_12_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

pymsis-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pymsis-0.7.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pymsis-0.7.0-cp310-cp310-macosx_12_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

pymsis-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pymsis-0.7.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pymsis-0.7.0-cp39-cp39-macosx_12_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

pymsis-0.7.0-cp38-cp38-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.8 Windows x86-64

pymsis-0.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pymsis-0.7.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pymsis-0.7.0-cp38-cp38-macosx_10_16_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pymsis-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c90d5ff2c41fc1b864ffcb5ed7153f8e20559a3392b1955deed2094b0a493bb4
MD5 c4de7dcffe203c85f904de7d9bab2c5c
BLAKE2b-256 0e5d400e8399a7d371c075ba66997789d35860f93bc8330d6ccf4ff0b89c1c2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.7.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.16

File hashes

Hashes for pymsis-0.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c151ff8a85dd7542fce3a06666fe27643196c325542f42a712f7ef5a4244ff8f
MD5 598953860ae7d9f265469136cc03c195
BLAKE2b-256 f3cf1e2ccbc00d19fc1f2c3726c902321f4ff8be604ea1d51c58bccbb1058e32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e32f7086c0bd962678d05d3daa36fce8d65f891a598ff601128a9d1d554d765e
MD5 d9a93661e957b59d2e2dcab28d4f92e7
BLAKE2b-256 6ed17bcb2e3363495a6a80e3a4cdf54fe59e4e52fdb5427a3d405b48603fd137

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 52aa39352b1bc651700b4fb002059115cb80318a82ad478e69ed9f7f14b40e1f
MD5 178bd230b1d18ffa095d0c24abc27877
BLAKE2b-256 abee556ac6deaf22cde4dfea6290542a3c9bbcd79da8aec2e46806da87ccf085

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 1e8d10dc241f7e926f394658ab7899061e2327132470f820bef74a2525e4a129
MD5 eb7ebaaa85b870d1b930893902d8d249
BLAKE2b-256 d223a4e985f5bfbc8cd014aa4d16cf6b4d36e21b9b9766fe86a75234a9c7fe1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.7.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.16

File hashes

Hashes for pymsis-0.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dd6a90aa329a97f5e925b44a5bfd83d7ade4860fd4952cf4ffb6abdad31e2670
MD5 fc8a7c11a941267acc20f57e95e4c2bd
BLAKE2b-256 a85fa2b1652588c6a007d433e58c4b320b90df098c73075b97bec2f566a96472

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 34de142e5899eb838c8281071564bcab0101dc73c82166ef13d72695b04f16f1
MD5 37beabf7371e08f76a97283d7a232154
BLAKE2b-256 ee8b603453379bfa7fc8d514c2b7bf0af73ce5c4b0097eb99cd2806853243dc9

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4a6414dbead5353a97344aa20172c17f25cb29a8e647919220a29e69ffdce6ec
MD5 5874be87b50bbfb569896b3e163e302a
BLAKE2b-256 acd382d1d5a85daa2d3d2bff32db0117cbc0b39d4302d4392a30ca1df7ff5749

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 b2c076a845fe28a36429acb535e9caa009ccbbe2c456ef33afd209d38740529c
MD5 8c4b737b367703bfac5aad0ee62ccf60
BLAKE2b-256 76e3493b03bed3959a02b127ef51beb8df7f9cae63ecf49c0c4a314e82193880

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.7.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.16

File hashes

Hashes for pymsis-0.7.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 83141ecc549dff628f3ac6d84a447e5f15817f3c070702a286c0a080b3deb6cc
MD5 95405e3429debafecc001cccc13788dc
BLAKE2b-256 d996ac79b6f93bf8d0156cab54ed5304367e2529112b2f46bc6751ddccb84db4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08ff4629070c8706e423735734cfeaf9f9c4f18224b46725ca8ee58f8fed2bba
MD5 f9b34a998b4b190128a57a4710d9c4fc
BLAKE2b-256 badabada9d35105bf2d2bff57e0f058f898048a6dcb8cbb4f3d5990a6e5886da

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e32daf7268f4a9bbbcf078a2513b0e5f088e851cae07e9c298101b3de2ff22f9
MD5 a92b059c51756a756c109f94ef56fb54
BLAKE2b-256 29384d13f623d7474ecbbf5ecd4e087391be3bda426e49051aa66eb9cdbbf8ad

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 284212a18d07dee444e8094b99acca210bd36bde575547834035f12a9d060457
MD5 03244bd65a1ca048f7645145a9d00273
BLAKE2b-256 52ed2f5fc318b0c162a7ca44961ded34f9a45626ac8ecbd92801677357109c4e

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pymsis-0.7.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pymsis-0.7.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 660ecb820ff16efaff3c56f87cc12a356680f78931809b4c47bc61f7ee9f5d37
MD5 5bd864a6c80a1b168622af58669616bb
BLAKE2b-256 c1a3098432deded4b5af1dd220cd1bdcab3f6cd1f55267b008a5857995ffdcc5

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe6f6ba351cf198da0808ccad3920fa7ce4a5f990ff3c5b681cdceb6eb73c7af
MD5 8c88338371ac048b1347d1c0e6c3e3d9
BLAKE2b-256 b03009e44b7a2497ea64a085e0d0ed2d96b80d2924c3e282593deb7afacd8e27

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e2fe32b20ba87887aedb5d95d8cb96906fe0f41ee9e2c32e80935595892e218b
MD5 ce1a431c1f7274c41b8fd8e580582acb
BLAKE2b-256 c246e3ea28f47b5c0ac6ad1777b88258aef3e6e7f5fe865a3e789d2e4bc0f3c3

See more details on using hashes here.

File details

Details for the file pymsis-0.7.0-cp38-cp38-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.7.0-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 3b7e067b45c2346e9ce3f725c25a0e9646148bfdb54fbe3ad0e2cda994c3b343
MD5 3012d93daf2e670cd654092f4698f259
BLAKE2b-256 d5f9fb19cd7e5e668c1403841a82fe7f2eb685a39330c31f5554eccd98012bfb

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