The FORTRAN GLobal airglOW (GLOW) Model in Python ≥ 3.9.
A Fortran compiler is REQUIRED.
Note: This version uses meson and ninja as the build system, and does not rely on distutils,
and is Python 3.12 compatible.
This library also allows parallelization of model evaluation using the multiprocessing module.
Additionally, the GlowModel class exposes complete control over model evaluation, which is divided
into the following fundamental steps:
initialize: Set the altitude, energy grids and solar flux model (Hinteregger, EUVAC, custom).setup: Set the model up for evaluation, specifying time, location, and optionally geomagnetic parameters. If geomagnetic parameters are not specified, they are retrieved usinggeomagdata.precipitation(optional): Evaluate the energy and flux of precipitating electrons (Maxwellian or monoenergetic).atmosphere: Evaluate the neutral atmosphere (MSISE-00) and ionosphere (IRI-90).radtrans: Evaluate the GLOW radiative transfer model to calculate volume emission rates and ion composition.result: Retrieve the model output as a xarray.Dataset.
Note: Between the atmosphere and radtrans steps, the intermediate dataset can be accessed using the result method by passing copy=False. This returns a reference to the internal dataset. Modifying the dataset in place allows for modifying the atmosphere and ionosphere presented to the radtrans step.
A Fortran compiler is REQUIRED.
Ensure that you have the following development packages installed:
build-essential(forgcc,g++,make, etc.)gfortran(Fortran compiler)
Ensure that you have the Xcode Command Line Tools installed. You can install them by running:
xcode-select --installInstall homebrew if you haven't already, and then install gfortran:
brew install gfortranNote: For macOS Big Sur and above, you may need to add the following line to your environment script (~/.zshrc if using ZSH, or the relevant shell init script):
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"Then reopen the terminal. This fixes the issue where -lSystem fails for gfortran.
The Windows installation is not officially supported at this time. However, you can try installing the MinGW-w64 toolchain and ensure that gfortran is available in your system's PATH. You may also consider using the Windows Subsystem for Linux (WSL) to set up a Linux-like environment on your Windows machine.
Direct installation using pip:
pip install glowpython2Install from source repository:
pip install glowpython2@git+https://github.com/sunipkm/glowpython2Requires (and installs) geomagdata for timezone aware geomagnetic parameter retrieval.
Maxwellian.py: Maxwellian precipitation, specify Q (flux) and E0 (characteristic energy).NoPrecipitation.py: No precipitating electrons.test_glow.py: Compares GLOW results betweenglowpythonandglowpython2modules without precipitation, as well as with NRLMSISE-2.1 atmosphere and IRI-2020 ionosphere.
These examples are also available on the command line: Glow2Maxwellian and Glow2NoPrecip.
In Python source code, import the module and call the maxwellian function:
import glowpython2 as glow
iono = glow.maxwellian(time, glat, glon, Nbins, Q, Echar)Read the module documentation for more information.
| Densities | Temperatures |
|---|---|
![]() |
![]() |
| Volume Emission Rates |
|---|
![]() |
The returned output is a xarray.Dataset containing outputs from GLOW:
- Coordinates:
alt_km: Altitude grid (km)energy: Energy grid (eV)state: Neutral/Ionic excitation states (string)wavelength: Wavelength of emission features in Angstrom (string). Represented as strings to accommodate the LBH band.tecscale: TEC scale factor (float)
- Data:
- Dimension (
alt_km):O: Neutral atomic oxygen density (cm^-3)O2: Neutral molecular oxygen density (cm^-3)N2: Neutral molecular nitrogen density (cm^-3)NO: Neutral nitric oxide density (cm^-3)NS: N(4S) density (cm^-3)ND: N(2D) density (not used, set to zero) (cm^-3)NeIn: Electron density (IRI-90), input to GLOW radiative transfer model. (cm^-3)O+: Ion atomic oxygen (4S) density (cm^-3)O+(2P): Ion atomic oxygen (2P) density (cm^-3)O+(2D): Ion atomic oxygen (2D) density (cm^-3)O2+: Ion molecular oxygen density (cm^-3)N+: Ion molecular nitrogen density (cm^-3)N2+: Ion molecular nitrogen density (cm^-3)NO+: Ion nitric oxide density (cm^-3)N2(A): Molecular nitrogen (GLOW) density (cm^-3)N(2P): N(2P) density (cm^-3)N(2D): N(2D) density (cm^-3)O(1S): O(1S) density (cm^-3)O(1D): O(1D) density (cm^-3)NeOut: Electron density (calculated below 200 km forkchem=4using GLOW model, cm^-3)Te: Electron temperature (K)Ti: Ion temperature (K)Tn: Neutral temperature (K)ionrate: Ionization rate (s^-1)pederson: Pederson conductivity (S/m)hall: Hall conductivity (S/m)eHeat: Ambient electron heating rate (eV/cm^3/s)Tez: Total energetic electron energy deposition (eV/cm^3/s)
- Dimension (
alt_km,wavelength):ver: Volume emission rate of various features (1/cm^3/s)
- Dimension (
alt_km,state):production: Production rate of various species (1/cm^3/s)loss: Fractional loss rate of various species (1/s)
- Dimension (
energy):precip: Precipitation flux (cm^-2/s/eV)
- Dimension (
- Attributes:
time: Time of evaluation (ISO 8601 formatted string)glatlon: Geographic latitude and longitude of evaluation (degrees)Q: Flux of precipitating electrons (erg/cm^2/s)Echar: Characteristic energy of precipitating electrons (eV)iscale: Solar flux model. 0: Hinteregger, 1: EUVACxuvfac: XUV enhancement factor.itail: Low energy tail enabled/disabled. 0: disabled, 1: enabledfmono: Monoenergetic energy flux (erg/cm^2).emono: Monoenergetic characteristic energy (keV).jlocal: Local calculation only (disable electron transport).kchem: GLOW chemistry level.
All available keys carry unit and description.
If you use this code in your work, please cite the repository:
@software{sunipkm_glowpython2_2025,
author = {Sunip K. Mukherjee},
title = {{glowpython2}: A Python Wrapper for the GLOW Model},
month = nov,
year = 2025,
publisher = {GitHub},
version = {v0.0.1},
doi = {https://zenodo.org/badge/latestdoi/1026267765},
url = {https://github.com/sunipkm/glowpython2},
}

