Skip to main content

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)
Scrutinizer quality status Codacy Code Quality Status

package

PyPI Package latest release Supported versions
PyPI Wheel Supported implementations

Release files for aacgmv2 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aacgmv2 2.7.1
File Size Uploaded
aacgmv2-2.7.1.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for aacgmv2 2.7.1
File Interpreter ABI Platform
aacgmv2-2.7.1-cp310-cp310-macosx_26_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 26.0+ x86-64 Details

Total release size: 3.2 MB

Release files / aacgmv2-2.7.1.tar.gz

Download URL aacgmv2-2.7.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
d00403a9c28dbda8de6edf8ff3850f17b050d1fa6f21ba4a915d377843ab8802
BLAKE2b-256 checksum
How to use checksums
1af644dd45db1d84bdda3e703bf96242fc947a690086ba7bf3d1a5a8ca53b872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / aacgmv2-2.7.1-cp310-cp310-macosx_26_0_x86_64.whl

Download URL aacgmv2-2.7.1-cp310-cp310-macosx_26_0_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 macOS 26.0+ x86-64
SHA-256 checksum
How to use checksums
59cb2ad3d1d07138ac3a43a05971c185cfccf79e85466acbc782235160724f64
BLAKE2b-256 checksum
How to use checksums
8f56218a63e3dbe3b87685b9bf61a99951360983bf3e6893a7093500e726c6a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.7.1 This release

2 release files

2.7.0

2 release files

2.6.3

2 release files

2.6.2

4 release files

2.6.1

5 release files

2.6.0

5 release files

2.5.3

4 release files

2.5.2

4 release files

2.5.1

4 release files

2.5.0

3 release files

2.4.2

6 release files

2.4.1

6 release files

2.4.0

5 release files

2.0.0

9 release files

1.0.13

9 release files

1.0.12

9 release files

1.0.11

9 release files

1.0.9

2 release files

1.0.8

1.0.7

9 release files

1.0.6

1.0.5

1.0.3

1.0.1

1.0.0

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page