Skip to content
Python wrapper to run, read, and plot the SAMI2 ionospheric model
Fortran Python Other
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github update to pr template Jun 21, 2019
docs Update introduction.rst May 17, 2019
sami2py Update Jul 3, 2019
.coveragerc omit test files Jun 22, 2019
.gitignore bugfixes Jun 14, 2019
.travis.yml back to nose! Jun 15, 2019 Create Apr 25, 2019 updates to contributing May 14, 2019 Update May 17, 2019 patch May 21, 2019 Update Jul 3, 2019

sami2py: sami2py is another model of the ionosphere python style

Build Status Coverage Status Documentation Status DOI

Full Documentation


Sami2py is a python module that runs the SAMI2 model, as well as archives, loads and plots the resulting modeled values. SAMI2 is a model developed by the Naval Research Laboratory to simulate the motions of plasma in a 2D ionospheric environment along a dipole magnetic field [Huba et al, 2000]. SAMI2 solves for the chemical and dynamical evolution of seven ion species in this environment (H+, He+, N+, O+, N2+, NO+, and O2+).

The implementation used here includes several added options to the original release of SAMI2. A full list is included in, but several of these include:

  • The ability to scale the neutral atmosphere in which the ions form through direct modification of the exospheric neutral temperature for extreme solar minimum conditions, as discussed by Emmert et al [2010].
  • The ability to input custom ExB drifts as a Fourier series.

This implementation is based on the matlab version used in Klenzing et al [2013].


First, checkout the repository:

  git clone

Change directories into the repository folder and run the file. For a local install use the "--user" flag after "install".

  cd sami2py/
  python install

Additionally, you must make and install the fortran executables.

  make -C sami2py/fortran compile

Now you can run the sami2 executable (sami2py.x) from anywhere.


In iPython, run:

  import sami2py

sami2py will remind you to set the top level directory that will hold the model output.


sami2py will raise an error if this is not done before trying to run the model.

  sami2py.run_model(year=2012, day=210, lon=0, tag='test')

Note that the sami2 model runs for 24 hours to clear transients, then begins to output data.

Now load the resultant data:

  ModelRun = sami2py.Model(tag='test', lon=0, year=2012, day=210)

Plotting features coming soon...

How to Cite

When referring to this software package, please cite the original paper by Huba et al [2000] as well as the package by Klenzing and Smith [2019]

Additionally, please include the following text in the acknowledgements: "This work uses the SAMI2 ionosphere model written and developed by the Naval Research Laboratory."


  • Huba, J.D., G. Joyce, and J.A. Fedder, Sami2 is Another Model of the Ionosphere (SAMI2): A new low‐latitude ionosphere model, J. Geophys. Res., 105, Pages 23035-23053,, 2000.
  • Emmert, J.T., J.L. Lean, and J.M. Picone, Record‐low thermospheric density during the 2008 solar minimum, Geophys. Res. Lett., 37,, 2010.
  • Klenzing, J., A. G. Burrell, R. A. Heelis, J. D. Huba, R. Pfaff, and F. Simões, Exploring the role of ionospheric drivers during the extreme solar minimum of 2008, Ann. Geophys., 31, 2147-2156,, 2013.
You can’t perform that action at this time.