Skip to main content

A Python wrapper for AACGM-v2 magnetic coordinates

Project description

RTD Documentation Status PyPI Package latest release DOI

This is a Python wrapper for the AACGM-v2 C library, which allows converting between geographic and magnetic coordinates. The currently included version of the C library is 2.7. The package is free software (MIT license). When referencing this package, please cite both the package DOI and the AACGM-v2 journal article:

Shepherd, S. G. (2014), Altitude‐adjusted corrected geomagnetic coordinates: Definition and functional approximations, Journal of Geophysical Research: Space Physics, 119, 7501–7521, doi:10.1002/2014JA020264.

Quick start

Install (requires NumPy):

pip install aacgmv2

Convert between AACGM and geographic coordinates:

>>> import aacgmv2
>>> import datetime as dt
>>> import numpy as np
>>> np.set_printoptions(formatter={'float_kind': lambda x:'{:.4f}'.format(x)})
>>> # geo to AACGM, single numbers
>>> dtime = dt.datetime(2013, 11, 3)
>>> np.array(aacgmv2.get_aacgm_coord(60, 15, 300, dtime))
array([57.4736, 93.6111, 1.4816])
>>> # AACGM to geo, mix arrays/numbers
>>> np.array2string(np.array(aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, method_code="A2G"))).replace('\n', '')
'[[82.9686 -74.3390] [-84.6501 125.8476] [14.1246 12.8772]]'

Convert between AACGM and MLT:

>>> import aacgmv2
>>> import datetime as dt
>>> import numpy as np
>>> np.set_printoptions(formatter={'float_kind': lambda x:'{:.4f}'.format(x)})
>>> # MLT to AACGM
>>> dtime = dt.datetime(2013, 11, 3, 0, 0, 0)
>>> np.array(aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True))
array([93.6203, -108.6130])

If you don’t know or use Python, you can also use the command line. See details in the full documentation.

Documentation

https://aacgmv2.readthedocs.io/en/latest/

https://superdarn.thayer.dartmouth.edu/aacgm.html

Badges

docs

RTD Documentation Status GitHub Actions Documentation Status

tests

GitHub Actions-CI Build Status Coverage Status (Coveralls)
CodeClimate Quality Status Scrutinizer Status Codacy Code Quality Status

package

PyPI Package latest release Supported versions
PyPI Wheel Supported implementations

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

aacgmv2-2.7.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

aacgmv2-2.7.0-cp310-cp310-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file aacgmv2-2.7.0.tar.gz.

File metadata

  • Download URL: aacgmv2-2.7.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aacgmv2-2.7.0.tar.gz
Algorithm Hash digest
SHA256 3bdad1aeb6aafd16b99da7d181c4dc3aa72946363cade2a761991cd13d396e62
MD5 995168313e701bf98310f8e88514dc95
BLAKE2b-256 4598cc4d672c958448551fa950ad67426cd4099dfcd69edf86d81ff60b841a8a

See more details on using hashes here.

File details

Details for the file aacgmv2-2.7.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for aacgmv2-2.7.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3adf6e532c6c1532eb6fe35b55a626044341f72c6fbf8b86528e7b58adbd95ae
MD5 8cac1ec8cce7654322068ba185f052b4
BLAKE2b-256 1495ba95bdd924ab97ab368b2e12a3e2e8772f96b293ed1a964b0e2030f2b6e6

See more details on using hashes here.

Supported by

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