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

Pymsis is meant to be a minimal and fast Python wrapper of the NRLMSIS models. Documentation to get started quickly can be found on the home page. It includes some examples that demonstrate how to access and plot the data.

Quickstart

A few short lines of code to get started quickly with pymsis. Use Numpy to create a range of dates during the 2003 Halloween storm. Then run the model at the location (lon, lat) (0, 0) and 400 km altitude. 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 note that for this example we only have one longitude, latitude, and altitude. The 11 is for each of the species MSIS calculates at each point of input. The first element is the Total Mass Density (kg/m3) and if we plot that over time, we can 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.tight_layout()
plt.show()

Additional examples that demonstrate how to access and plot the data.

API Documentation with details about the various options and configurations available.

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.

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.

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

Uploaded Source

Built Distributions

pymsis-0.6.0-cp311-cp311-win_amd64.whl (980.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

pymsis-0.6.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.6.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.6.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.6.0-cp310-cp310-win_amd64.whl (981.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

pymsis-0.6.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.6.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.6.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.6.0-cp39-cp39-win_amd64.whl (979.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

pymsis-0.6.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.6.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.6.0-cp39-cp39-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pymsis-0.6.0-cp38-cp38-win_amd64.whl (976.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pymsis-0.6.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.6.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.6.0-cp38-cp38-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pymsis-0.6.0.tar.gz
  • Upload date:
  • Size: 109.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pymsis-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4ba51f9f32e99b5e3ee8cf2f7381dc4718cf189355954f10bc7907fc8eeb1896
MD5 277e9c5bd2c382945f5573de9e7ee268
BLAKE2b-256 4342f1dbba071ff6e86f60b84705729355ee513399205fed8ac72476b6116559

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 980.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pymsis-0.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 de7c4bf38bec9f227ae4fbaf3eceee94f21b47a641797bb27094156193dade3f
MD5 d1b473f90b9b3dac70d8ed381535b0a1
BLAKE2b-256 a2e656eeef4626a1fb61e436be071231023a5b9d3643b707d88cc6fb2b85894b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1342f6513ad11ce4b822afb77006247c5353abd0735a8589917aca96ab4c7759
MD5 bc6c85282feb3a8883080c13ac8ccdb1
BLAKE2b-256 9cde860a4a32bc4da465870ecabb13f043d4d0355da54758033d854040e3d56f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8f2d5d5ab5ae9ddef2bc1b16383d3d5f14c16665a9b5f029f69fb5837cf4cf1d
MD5 e40173cfeb801bd7b1706dc220fa5daf
BLAKE2b-256 65219ec84284b0279f22af24ff88e4e36bc236f34d16200abc512049372c4f8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bd8aecc0da88af41826304a9b8c5ad1c4310922d3614e6ef8c0e25cae9160f90
MD5 7e210df8673eaca646e21be353ce48f0
BLAKE2b-256 8495bbfd8f163711c31a1f7388657ade8fce79aaa9d5eb14858e0d007b395746

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 981.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pymsis-0.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 57105a9652a483e91b9dd67fdef4cc9771251fe236d10e990b50cc2b384492ce
MD5 4fd724ddec1b1b16aa91f8734a635b4d
BLAKE2b-256 a8e8f22b46858e52ed53430ecc6127f053118373ac95d3c057435f11fc127317

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 78e40150c55e95c0bb6cf7b3d7fcceb59086c45c9038051a424733f31acb294f
MD5 21cfeb6495c196ec6f40eb7d0eb1128c
BLAKE2b-256 912ac6c603918be4c2cba41550d818e41c4ef616b2e199980d93b0709ed4241b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d9e8f1a590dc5e6254b3af3854fe243144c691b410e8940ecfd0807ed3bee111
MD5 fc292d558a68ed72320b6319dd1490b2
BLAKE2b-256 2304aafea1ab526a6079300ab686c79b5741e693e9672ec1024aff34d4f70680

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2f37d82f748beda917e959f190a7801c203eaffe75b57d1c4d0215b7c36b0fc7
MD5 ec2eff0a88dacae63b8a79578bfe9ec0
BLAKE2b-256 2b186b9e87d0e5adec467fc43760e0fa7901604ad280d0e6149dc2dd34901233

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 979.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pymsis-0.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bb3bfc84e5941a542cc5fb60885513702e2c8cd6bdddccc0a971cb26d4512034
MD5 bf21d4d4e48f48d46e20f7c4a2778598
BLAKE2b-256 c0e2338691ab7e1344303c2376f1622a477ec4d0b21547418a139beb1371de52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1df1c2705c277dec1dd53441fa4c5120f1c5c8fdb30d9304ffc4dad30a0b2ed2
MD5 d220b718c9877c8d12a9425b4b09fa12
BLAKE2b-256 5a5c1308621165e292a956ef5420ae130e2d68b82f9d0a0f0685f0a83736fd14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1be8fe37bf8ef7fc6bc45cd300d02f6200cc78437b29487f6a2cbfde84ba9eab
MD5 01c360d45acedf0593c8da7d188ac903
BLAKE2b-256 f12896649e48e4e06b2f0050a53491bbd362cfd80549f29ef0536ea1d32a619e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1df932d92d8904696381fe64fdb23bda32e87a2330295c8565b08bdb20c37e86
MD5 05acd89b019d25412e04fc24eb210245
BLAKE2b-256 0e2579ac393a6d3b4a598c232b54ebd3dbb1462c6f4236a68667b373d4dd6cc7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymsis-0.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 976.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pymsis-0.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6dbfd3f5717e2b90e2cf53e10c582853df73c416b658f6c86f46eb260a05bdbd
MD5 ca542de968d307d2f5c8a28eefd907a6
BLAKE2b-256 bd5e2041aa42e13131f417367ef1249c4fd1cbb13c104788a8e85fa4a5a82ebe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 675d755268ed0973a4edcc694b9e93cf68eac04a942f6316e03a5cf105c164ba
MD5 f9e31fffa16a2c6cdf22688eb49f4735
BLAKE2b-256 c5b747d89a8d499f19940fe66860109dfe3ccac87a8810611ad64f3c22d9b3ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymsis-0.6.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 cd00daec2254e5cb518e2a04d58ab62b737d9383793c219232af85b06c2a1512
MD5 2c0b618778619529be9988e0aab7e25b
BLAKE2b-256 f802c2dc5ea26acc3039dc962877dc9906f1203aa45c207c6d459642966a9b7a

See more details on using hashes here.

File details

Details for the file pymsis-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymsis-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ab340a5464638e74bdff07134040b35fb5824b479a1821d5786aaee3fed2b281
MD5 e5a521b33d6c4d661640142e8d35a236
BLAKE2b-256 7836863b487606628ca757f71fe6ab07f1514104bfd424e36b1762661046df1b

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