Upper atmosphere climatological models in Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/pyglow
static Model retrieval script fixup (#52) Nov 11, 2018
tests Python3 compatibility (#50) Nov 10, 2018
.gitignore
License.md
README.md Update geophysical indice instructions (#54) Nov 11, 2018
logo.png
setup.py Package reorganization (#53) Nov 11, 2018

README.md

alt text (airglow viewed aboard the ISS)

Overview

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 2014
  • HWM 2007
  • HWM 1993
  • IGRF 12
  • IGRF 11
  • IRI 2016
  • IRI 2012
  • 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.

Prerequisites

pyglow requires the following packages for installation:

  1. gfortran ($ sudo apt-get install gfortran)

Installation

I'm Feeling Lucky:

First, checkout the repository:

    $ git clone git://github.com/timduly4/pyglow.git pyglow

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

    $ cd pyglow/
    $ make -C src/pyglow/models source
    $ python setup.py install --user

Individual installation steps:

If you have troubles, follow the individual installation steps:

(1) Download the package:

    $ git clone git://github.com/timduly4/pyglow.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"
    ./dl_models/hwm07/hwm07py.so
    ./dl_models/hwm93/hwm93py.so
    ./dl_models/hwm14/hwm14py.so
    ./dl_models/igrf11/igrf11py.so
    ./dl_models/igrf12/igrf12py.so
    ./dl_models/iri12/iri12py.so
    ./dl_models/iri16/iri16py.so
    ./dl_models/msis/msis00py.so
    

(3) Install the python package

    $ cd ../../../   # get back to root directory
    $ python setup.py install --user --prefix=
  • On a mac, the folder pyglow and *.so files from ./models/dl_models/<model>/ should be in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
  • If you are denied permission, I recommend adding --user flag in command

(4) Download the geophysical indices

	$ cd ~/
	$ python -c "import pyglow; pyglow.update_indices()"

Testing / Examples

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

Hints

General

  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()

  1. 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 for 2017 and 2018:
~ $ python -c "import pyglow; pyglow.update_indices([2017, 2018])"

# Grabs all indices starting from 1932 to the current year:
~ $ python -c "import pyglow; pyglow.update_indices()"
  • Note: you only need to run this function when you would like to update the indices.

Uninstallation

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

~ $ python -c "import pyglow; print(pyglow.__file__)"
/Users/duly/Library/Python/2.7/lib/python/site-packages/pyglow/__init__.pyc

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

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