pymsis
Python interface to the NRLMSIS codes for calculating atmospheric densities and constituents at satellite altitudes
Science Score: 85.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 21 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
1 of 3 committers (33.3%) from academic institutions -
✓Institutional organization owner
Organization swxtrec has institutional domain (www.colorado.edu) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.0%) to scientific vocabulary
Keywords
Repository
Python interface to the NRLMSIS codes for calculating atmospheric densities and constituents at satellite altitudes
Basic Info
- Host: GitHub
- Owner: SWxTREC
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://swxtrec.github.io/pymsis/
- Size: 40.3 MB
Statistics
- Stars: 31
- Watchers: 3
- Forks: 9
- Open Issues: 5
- Releases: 10
Topics
Metadata Files
README.md
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). The MSIS model is developed by the Naval Research Laboratory. For quick access to the model data without any code, there is a web viewer that uses pymsis: https://swx-trec.com/msis
Quickstart
- Documentation
- API Reference: Details about the various options and configurations available in the functions.
- Examples: Demo for how to access and plot the data.
- Web viewer: An interactive website using pymsis through cloud-based serverless functions.
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.
```python import numpy as np import pymsis
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 = pymsis.calculate(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]. -s 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, utility functions are provided 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.
bash
pip install pymsis
For the most up-to-date pymsis, you can install directly from the git repository
bash
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.
bash
git clone https://github.com/SWxTREC/pymsis.git
cd pymsis
pip install .[test]
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.gzfile to your local system.Extract the source files The tar file needs to be extracted to the
src/msis2.0directory.bash tar -xvzf NRLMSIS2.0.tar.gz -C src/msis2.0/Install the Python package
bash pip install .
Owner
- Name: Space Weather Technology Research and Education Center
- Login: SWxTREC
- Kind: organization
- Location: Boulder, CO
- Website: https://www.colorado.edu/spaceweather/
- Twitter: SpaceWeatherCU
- Repositories: 11
- Profile: https://github.com/SWxTREC
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Lucas"
given-names: "Greg"
email: greg.lucas@lasp.colorado.edu
affiliation: >-
University of Colorado Laboratory for
Atmospheric and Space Physics (LASP)
orcid: "https://orcid.org/0000-0003-1331-1863"
title: "pymsis"
version: v0.10.0
doi: 10.5281/zenodo.5348502
date-released: 2024-04-04
url: "https://github.com/SWxTREC/pymsis"
GitHub Events
Total
- Create event: 5
- Release event: 2
- Issues event: 18
- Watch event: 9
- Delete event: 2
- Issue comment event: 37
- Push event: 23
- Pull request review event: 5
- Pull request review comment event: 7
- Pull request event: 30
- Fork event: 6
Last Year
- Create event: 5
- Release event: 2
- Issues event: 18
- Watch event: 9
- Delete event: 2
- Issue comment event: 37
- Push event: 23
- Pull request review event: 5
- Pull request review comment event: 7
- Pull request event: 30
- Fork event: 6
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Greg Lucas | g****s@g****m | 71 |
| Greg Lucas | g****s@l****u | 61 |
| pre-commit-ci[bot] | 6****] | 4 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 23
- Total pull requests: 67
- Average time to close issues: about 2 months
- Average time to close pull requests: 9 days
- Total issue authors: 14
- Total pull request authors: 5
- Average comments per issue: 2.0
- Average comments per pull request: 0.48
- Merged pull requests: 60
- Bot issues: 0
- Bot pull requests: 10
Past Year
- Issues: 14
- Pull requests: 23
- Average time to close issues: 25 days
- Average time to close pull requests: 1 day
- Issue authors: 9
- Pull request authors: 4
- Average comments per issue: 2.07
- Average comments per pull request: 0.35
- Merged pull requests: 19
- Bot issues: 0
- Bot pull requests: 4
Top Authors
Issue Authors
- greglucas (6)
- AstroEloy (3)
- ssmong (2)
- alokshenoy (1)
- frncaldas (1)
- cecantrall (1)
- mauro835 (1)
- Soulboy1234 (1)
- rogervarney (1)
- pkalaczynski (1)
- scottshambaugh (1)
- kylestanevich (1)
- mananapr (1)
- Bownnw (1)
Pull Request Authors
- greglucas (71)
- pre-commit-ci[bot] (13)
- mananapr (3)
- tbridel (1)
- scottshambaugh (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 2,172 last-month
- Total dependent packages: 3
- Total dependent repositories: 2
- Total versions: 13
- Total maintainers: 1
pypi.org: pymsis
A Python wrapper around the NRLMSIS model.
- Documentation: https://pymsis.readthedocs.io/
- License: MIT License Copyright (c) 2020, Regents of the University of Colorado Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 0.11.0
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- matplotlib *
- numpy *
- pydata-sphinx-theme *
- sphinx *
- sphinx_gallery *
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v2 composite
- ad-m/github-push-action master composite
- modflowpy/install-gfortran-action v1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- modflowpy/install-gfortran-action v1 composite
- actions/checkout v3 composite
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- docker/setup-qemu-action v1 composite
- modflowpy/install-gfortran-action v1 composite
- pypa/cibuildwheel v2.11.2 composite
- pypa/gh-action-pypi-publish master composite
- numpy *