Skip to main content

MSISE-00 in Python and Matlab

Zenodo DOI python matlab PyPi Download stats

NRL MSISE-00 atmospheric model for Python. Also accessible via Matlab. 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

Units

  • Temperature: degrees Kelvin [K]
  • Density: particles per cubic meter [m^-3]
  • Mass density: kilograms per cubic meter [kg m^-3]

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

pip install -e msise00

optionally check that MSIS is working via:

pytest 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 under Examples/

  • Altitude Profile at a single time:

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

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

    msise00 -t 2016-09-20 2016-09-21
    
  • single time lat/lon can be plotted:

    msise00 -t 2017-01-02T12
    

Matlab

Matlab use of MSISE00 is demonstrated in Examples

MSISE00 will automatically compile "build on run" on first run from Matlab as with Python.

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

buildtool test

Fortran

Those wishing to use MSIS from a plain Fortran program can do from the top-level msise00/ directory:

cmake -B build
cmake --build build

optionally:

ctest --test-dir build

Reference

  • Original fortran code
  • 1200+ citations 2002 paper

Release files for msise00 1.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for msise00 1.11.1
File Size Uploaded
msise00-1.11.1.tar.gz 37.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for msise00 1.11.1
File Interpreter ABI Platform
msise00-1.11.1-py3-none-any.whl Python 3 none any Details

Total release size: 76.4 kB

Release files / msise00-1.11.1.tar.gz

Download URL msise00-1.11.1.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e6e8d357d7f2a56ffbd6eb3fc3b3f870d37c05e46aeb661e8d8eee063c7cbe99
BLAKE2b-256 checksum
How to use checksums
adda65a51dd71f68f64fdcb895a8ca3d6948c1ff98f1554d73e95fa4cc4790be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release files / msise00-1.11.1-py3-none-any.whl

Download URL msise00-1.11.1-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2825255554b0992b71477d05cf032e41a41864d13ed835ee61476f5bcf25beca
BLAKE2b-256 checksum
How to use checksums
4d9df17efcf3a7854c108708df132db88285e387a6feb469bb21444b88661359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

1.11.1 This release

2 release files

1.11.0

2 release files

1.10.1

1 release file

1.10.0

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0.2

1 release file

1.3.0.1

1 release file

1.3.0

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.3

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.9.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page