Skip to main content

Atomspheric ionization from auroral particle precipitation

Project description

PyEPPAurora

Atmospheric ionization from particle precipitation

builds docs package wheel pyversions codecov coveralls scrutinizer

doi

Bundles some of the parametrizations for middle and upper atmospheric ionization and recombination rates for precipitating auroral and radiation-belt electrons as well as protons. Includes also some recombination rate parametrizations to convert the ionization rates to electron densities in the upper atmosphere. See References for a list of included parametrizations.

:warning: This package is in beta stage, that is, it works for the most part and the interface should not change (much) in future versions.

Documentation is available at https://pyeppaurora.readthedocs.io.

Install

Requirements

  • numpy - required
  • scipy - required for 2-D interpolation
  • h5netcdf - optional for the empirical models, install with eppaurora[models]
  • xarray - optional for the empirical models, install with eppaurora[models]
  • pytest - optional, for testing

eppaurora

An installable pip package called eppaurora is available from the main package repository, it can be installed with:

$ pip install eppaurora

The latest development version can be installed with pip directly from github (see https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support and https://pip.pypa.io/en/stable/reference/pip_install/#git):

$ pip install [-e] git+https://github.com/st-bender/pyeppaurora.git

The other option is to use a local clone:

$ git clone https://github.com/st-bender/pyeppaurora.git
$ cd pyeppaurora

and then using pip (optionally using -e, see https://pip.pypa.io/en/stable/reference/pip_install/#install-editable):

$ pip install [-e] .

or using setup.py:

$ python setup.py install

Optionally, test the correct function of the module with

$ py.test [-v]

or even including the doctests in this document:

$ py.test [-v] --doctest-glob='*.md'

Usage

The python module itself is named eppaurora and is imported as usual.

All functions should be numpy-compatible and work with scalars and appropriately shaped arrays.

>>> import eppaurora as aur
>>> ediss = aur.rr1987(1., 1., 8e5, 5e-10)
>>> ediss
3.3693621076457477e-10
>>> import numpy as np
>>> energies = np.logspace(-1, 2, 4)
>>> fluxes = np.ones_like(energies)
>>> # ca. 100, 150, 200 km
>>> scale_heights = np.array([6e5, 27e5, 40e5])
>>> rhos = np.array([5e-10, 1.7e-12, 2.6e-13])
>>> # energy dissipation "profiles"
>>> # broadcast to the right shape
>>> ediss_prof = aur.fang2008(
... 	energies[None, :], fluxes[None, :],
... 	scale_heights[:, None], rhos[:, None]
... )
>>> ediss_prof
array([[1.37708081e-49, 3.04153876e-09, 4.44256875e-07, 2.52699970e-08],
       [1.60060833e-09, 8.63248169e-08, 3.64564419e-09, 1.62591310e-10],
       [5.19369952e-08, 2.34089350e-08, 5.17379303e-10, 3.19504690e-11]])

Basic class and method documentation is accessible via pydoc:

$ pydoc eppaurora
$ pydoc eppaurora.brems
$ pydoc eppaurora.conductivity
$ pydoc eppaurora.electrons
$ pydoc eppaurora.protons
$ pydoc eppaurora.recombination

References

Electron ionization

[1]: Roble and Ridley, Ann. Geophys., 5A(6), 369--382, 1987
[2]: Fang et al., J. Geophys. Res. Space Phys., 113, A09311, 2008, doi: 10.1029/2008JA013384
[3]: Fang et al., Geophys. Res. Lett., 37, L22106, 2010, doi: 10.1029/2010GL045406

Ionization by secondary electrons from bremsstrahlung

[4]: Berger et al., Journal of Atmospheric and Terrestrial Physics, Volume 36, Issue 4, 591--617, April 1974, doi: 10.1016/0021-9169(74)90085-3

Proton ionization

[5]: Fang et al., J. Geophys. Res. Space Phys., 118, 5369--5378, 2013, doi: 10.1002/jgra.50484

Recombination rates

[6]: Vickrey et al., J. Geophys. Res. Space Phys., 87, A7, 5184--5196, doi: 10.1029/ja087ia07p05184
[7]: Gledhill, Radio Sci., 21, 3, 399-408, doi: 10.1029/rs021i003p00399
[8]: https://ssusi.jhuapl.edu/data_algorithms

Conductivity and conductance

[9]: Brekke et al., J. Geophys. Res., 79(25), 3773--3790, Sept. 1974, doi: 10.1029/JA079i025p03773
[10]: Vickrey et al., J. Geophys. Res., 86(A1), 65--75, Jan. 1981, doi: 10.1029/JA086iA01p00065
[11]: Robinson et al., J. Geophys. Res. Space Phys., 92(A3), 2565--2569, Mar. 1987, doi: 10.1029/JA092iA03p02565

License

This python interface is free software: you can redistribute it or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 (GPLv2), see local copy or online version.

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

eppaurora-0.3.0.tar.gz (183.6 kB view details)

Uploaded Source

Built Distribution

eppaurora-0.3.0-py2.py3-none-any.whl (178.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file eppaurora-0.3.0.tar.gz.

File metadata

  • Download URL: eppaurora-0.3.0.tar.gz
  • Upload date:
  • Size: 183.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for eppaurora-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7fb8274ee193593ccf8e45440237b2e686ff36d5b2271cacb67e5c77278c9147
MD5 e2d2faa732fba42373eaccb2e2b09611
BLAKE2b-256 38b01a4b9a0f97f8fd15135ecdf58dbd47c4f9d5a154cedc503641b66c981b5c

See more details on using hashes here.

File details

Details for the file eppaurora-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: eppaurora-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 178.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for eppaurora-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0af762709d37303ee1a8cdefcbf1b7604d3e0a1c881ee80bf22439c2c5bb07b9
MD5 13845b8536189ad0487a4faf896b0d30
BLAKE2b-256 f60e5e185310fb500f81d9398b162ea0e5c14a532111700abcaa9bd0bb7ad835

See more details on using hashes here.

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