Skip to content
NRL MSISE-00 atmospheric model-- in Python and Matlab!
Fortran Python MATLAB Makefile CMake Meson
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github add ninja prereqs Nov 12, 2019
archive allow more direct atomic access Sep 26, 2019
matlab set temperature abstol to 0.01 Nov 11, 2019
msise00 matlab: refactor to latest build on run Nov 11, 2019
reference breakup tests for better clarity, docs Aug 28, 2019
tests set temperature abstol to 0.01 Nov 11, 2019
.coveragerc setup template Jan 20, 2019
.editorconfig Squashed commit of the following: Mar 13, 2019
.flake8 breakup tests for better clarity, docs Aug 28, 2019
.gitattributes linguist vendored Aug 22, 2018
.gitignore matlab demo [ci skip] Jul 24, 2018
AltitudeProfile.py simplify Matlab build to need only compiler. black code style. update… Aug 27, 2019
CODE_OF_CONDUCT.md apply build on run template Nov 11, 2019
LICENSE.txt build in package dir with default gfortran Jun 30, 2019
MANIFEST.in apply build on run template Nov 11, 2019
MSISE00.py breakup tests for better clarity, docs Aug 28, 2019
README.md add ninja prereqs Nov 12, 2019
TimeProfile.py Squashed commit of the following: Mar 13, 2019
Worldgrid.py simplify Matlab build to need only compiler. black code style. update… Aug 27, 2019
mypy.ini allow more direct atomic access Sep 26, 2019
pyproject.toml breakup tests for better clarity, docs Aug 28, 2019
pytest.ini apply build on run template Nov 11, 2019
setup.cfg add ninja prereqs Nov 12, 2019
setup.py simplify Matlab build to need only compiler. black code style. update… Aug 27, 2019
suntest.py simplify Matlab build to need only compiler. black code style. update… Aug 27, 2019

README.md

Zenodo DOI

Actions Status

Python versions (PyPI) PyPi Download stats

MSISE-00 in Python and Matlab

NRL MSISE-00 atmospheric model for Python ≥ 3.6, also accessible via Matlab or GNU Octave. Valid from altitude z = 0..1000 km.

The plot immediately below shows a slice at 200km on a world-wide grid. The yellow ball represents the sun footprint on Earth.

MSIS global time animation

This plot is from Matlab calling MSISE00:

MSISE00 Matlab

Install

This process is used for the Python and Matlab access to MSIS. Any Fortran compiler should work. Fortran compiler may be installed by

  • MacOS / Homebrew: brew install gcc
  • Linux: apt install gfortran
  • Windows

Get MSISE00 and install Python package:

pip install msise00

or for the latest development code

git clone https://github.com/space-physics/msise00

python -m pip install -e msise00

This Python module uses our build-on-run technique. The first time you use this Python module, you will see messages from the Meson build system.

Examples

MSISE00 can be used from the command line, as an imported module, and even from Matlab.

import module

import msise00
from datetime import datetime

atmos = msise00.run(time=datetime(2013, 3, 31, 12), altkm=150., glat=65., glon=-148.)

atmos is an xarray.Dataset containing all the simulation output values. atmos is 4-D: (time, altitude, lat, lon), and indexed like atmos['N2']

Command Line

Write NetCDF4 output (HDF5 compatible) with command line argument -w filename.nc.

Simple examples include:

  • AltitudeProfile.py

  • TimeProfile.py

  • Worldgrid.py

  • Altitude Profile at a single time:

    python MSISE00.py -t 2017-08-21T20:48 -c 40 -90
  • Alt. profile time-range with hourly time step:

    python MSISE00.py -t 2017-08-21 2017-08-22 -c 40 -90
  • Grid: time,lat,lon: generates the plots in the README:

    python MSISE00.py -t 2016-09-20 2016-09-21
  • single time lat/lon can be plotted:

    python MSISE00.py -t 2017-01-02T12

Matlab

Matlab and GNU Octave users use of MSISE00 is demonstrated in AltitudeProfile.m and msise00.m.

MSISE00 will automatically compile "build on run" on first run from Matlab or Octave.

Optionally, verify Matlab is working by from the top msise00/ directory in Terminal

matlab -batch runtests('tests')

Reference

  • Original fortran code
  • 1200+ citations 2002 paper
You can’t perform that action at this time.