Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Semaphore CI: Build Status

Travis CI: Build Status

(airglow viewed aboard the ISS)


pyglow is a Python module that wraps several upper atmosphere climatological models written in FORTRAN, such as the Horizontal Wind Model (HWM), the International Geomagnetic Reference Field (IGRF), the International Reference Ionosphere (IRI), and the Mass Spectrometer and Incoherent Scatter Radar (MSIS).

It includes the following upper atmospheric models:

  • HWM 1993
  • HWM 2007
  • HWM 2014
  • IGRF 11
  • IGRF 12
  • IRI 2012
  • IRI 2016
  • MSIS 2000

pyglow also provides access to the the following geophysical indices:

  • AP
  • Kp
  • F10.7
  • DST
  • AE

pyglow offers access to these models & indices in a convenient, high-level object-oriented interface within Python.


pyglow requires the following packages for installation:

  1. gfortran ($ sudo apt-get install gfortran)
  2. f2py ($ pip install numpy --upgrade)
  3. Python packages listed in requirements.txt ($ pip install -r requirements.txt)


I'm Feeling Lucky:

First, checkout the repository:

$ git clone git:// pyglow

Change directories into the repository folder, compile the f2py bindings, then install the Python package:

$ cd pyglow/
$ make -C src/pyglow/models source
$ python3 install --user

Trouble in downloading model files:

If you have problems downloading files from the official websites, follow the next steps:

(1) Create the local http server:

$ cd static/
$ python3 -m http.server 8080

(2) Edit the file src/pyglow/models/Makefile, replace the appropriate line with the following code:


(3) Compile the f2py bindings, then install the Python package:

$ cd pyglow/
$ make -C src/pyglow/models source
$ python3 install --user

Note: The model files may not be latest.

Individual installation steps:

If you have troubles, follow the individual installation steps:

(1) Download the package:

$ git clone git://
$ cd pyglow/

(2) Download the climatological models and wrap them with f2py:

$ cd ./src/pyglow/models/
$ make all
  • If successful, there should be a *.so file in each of the ./models/dl_models/<model>/ directories:

    $ find . -name "*.so"

(3) Install the Python package

$ cd ../../../   # get back to root directory
$ python3 install --user
  • On a mac, the folder pyglow and *.so files from ./models/dl_models/<model>/ should be in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
  • The --user flag installs the package locally (i.e., you do not need sudo access)

Unit tests

See unit tests in ./test. For example, run the unittest suite with:

$ pytest test/

(Be sure that the f2py modules have been compiled via $ make -C src/pyglow/models source, first.)


See example scripts located in ./examples for example calls to pyglow.


We've included a Dockerfile for pyglow. To build the image:

$ docker build -t pyglow .

This will compile and install pyglow within the Docker container.

Run the unit tests within the container via:

$ docker run pyglow



  1. Use tab completion in ipython to view the full set of member data and variables available in the Point class.
  • For example, in the test code, run pt.<TAB><TAB> and class information will be listed.

Updating geophysical indices with pyglow.update_indices()

You'll need to download the geophysical indices as they become available. The update_indices() function is available in pyglow that enables you do this:

# Grabs indices between 2016 and 2018:
$ python3 -c "import pyglow; pyglow.update_indices(2016, 2018)"

Note: you only need to run this function when you would like to update the indices.

You can check if you have geophysical indices between dates with:

$ python3 -c "import pyglow;  pyglow.check_stored_indices('2015-01-01', '2019-01-01')"

Checking: input date range:
>> We have all of the geophysical indices files between these dates.


The install directory for pyglow can be outputted via python3 -c "import pyglow; print(pyglow.__file__)". For example:

~ $ python3 -c "import pyglow; print(pyglow.__file__)"

This tells you the installation location, and then you can remove the package with:

~ $ rm -rf /Users/duly/Library/Python/3.7/lib/python/site-packages/pyglow


Upper atmosphere climatological models in Python







No releases published


No packages published