Skip to main content

Python bindings for NCAR GLOW model

Project description

GLOW

The GLobal airglOW Model, independently and easily accessed from Fortran 2003 compiler. Optionally available from Python ≥ 3.7.

A Fortran compiler, as well as the meson build system, is REQUIRED.

Installation

Direct install using pip:

$ pip install glowpython

Install from source repository by:

$ git clone https://github.com/sunipkm/glowpython
$ cd glowpython && pip install .

Requires (and installs) geomagdata for timezone aware geomagnetic parameters retrieval.

Confirm the install with:

pytest glowpython

Then use examples such as:

  • Maxwellian.py: Maxwellian precipiation, specify Q and E0.
  • Monoenergetic.py: Specify unit flux for one energy bin, all other energy bins are zero flux.
  • NoPrecipitation.py: No precipitating electrons.

or use GLOW in your own Python program by:

import glowpython as glow

iono = glow.maxwellian(time, glat, glon, Q, Echar, Nbins)

iono is an xarray.Dataset containing outputs from GLOW, including:

  • number densities of neutrals, ions and electrons
  • Pedersen and Hall currents
  • volume emssion rate vs. wavelength and altitude
  • precipitating flux vs. energy
  • many more, request if you want it.

All available keys carry unit and description.

Fortran

You can call this repo from a Meson wrap or CMake Fetch. To build Fortran code by itself, do either:

meson build

meson test -C build

or

cmake -B build

cmake --build build

MPI / NetCDF

The parallel version of GLOW requires MPI and NetCDF for TIEGCM I/O.

mpirun -np 2 ./mpi_glow.bin < ~/data/in.namelist.tgcm

Note, for an unknown reason, in.namelist.msis only works with -O0 or -O1 with gfortran 7. We didn't look into why. Otherwise, -O3 works fine.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glowpython-2.0.0.tar.gz (497.1 kB view hashes)

Uploaded Source

Built Distribution

glowpython-2.0.0-py3-none-any.whl (528.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page