Skip to main content

A Python wrapper for AACGM-v2 magnetic coordinates

Project description

Documentation Status PyPI Package latest release

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.6. The wrapper is provided “as is” in the hopes that it will be useful to the space science community, and will not automatically be updated when new versions of the C library is released. MLT calculations are included in the wrapper (not part of the C library, please see the documentation for implementation details). The package is free software (MIT license).

This fork of aacgmv2 (github link) provides the interface compatible with aacgmv2 < 2.4.

Quick start

Install (requires NumPy):

pip install aacgm2

Convert between AACGM and geographic coordinates:

>>> from aacgm2 import convert
>>> from datetime import date
>>> # geo to AACGM, single numbers
>>> mlat, mlon, malt = convert(60, 15, 300, date(2013, 11, 3))
>>> "{0:.8f}".format(float(mlat))
'57.47357891'
>>> "{0:.8f}".format(float(mlon))
'93.61113360'
>>> "{0:.8f}".format(float(malt))
'1.04566346'
>>> # AACGM to geo, mix arrays/numbers
>>> glat, glon, galt = convert([90, -90], 0, 0, date(2013, 11, 3), a2g=True)
>>> ["{0:.8f}".format(float(gl)) for gl in glat]
['82.96859922', '-74.33899667']
>>> ["{0:.8f}".format(float(gl)) for gl in glon]
['-84.65010944', '125.84759847']
>>> ["{0:.8f}".format(float(ga)) for ga in galt]
['14.12457922', '12.87721946']

Convert between AACGM and MLT:

>>> from aacgm2 import convert_mlt
>>> from datetime import datetime
>>> mlon = convert_mlt([0, 12], datetime(2013, 11, 3, 18, 0), m2a=True)
>>> ["{0:.8f}".format(float(ml)) for ml in mlon]
['159.08043649', '339.08043649']

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

Documentation

https://aacgm2.readthedocs.org/

Badges

docs

Documentation Status

tests

Travis-CI Build Status AppVeyor Build Status Requirements Status
Coverage Status Coverage Status
Scrutinizer Status Codacy Code Quality Status

package

PyPI Package latest release Supported versions
PyPI Wheel Supported implementations

Changelog

2.6.0 (2020-08-16)

  • Same as 2.6.0-rc2

2.6.0-rc2 (2020-08-14)

  • Binary wheels for MacOSX

2.6.0-rc1 (2020-08-12)

  • Updated AACGM-v2 coefficients derived using the IGRF13 model

  • Updated IGRF and GUFM1 coefficients using the IGRF13 model

  • Added additional checks to the C code for reading the IGRF13 coefficient file

  • Updated CI setup on travis and appveyor

  • Deployment of linux and osx wheels to the package index

  • Changed version support to 2.7, 3.4, 3.5, 3.6, 3.7, and 3.8

  • Updated test values to match new coefficients

2.5.0 (unreleased)

  • Updated C code and coefficients to version 2.5.

2.3.9 (2018-05-27)

  • Update to AACGM-v2.4, which includes changes to the inverse MLT and dipole tilt functions and some minor bug fixes

  • Updated dependencies

  • Removed support for python 3.3

2.0.0 (2016-11-03)

  • Change method of calculating MLT, see documentation of convert_mlt for details

1.0.13 (2015-10-30)

  • Correctly convert output of subsol() to geodetic coordinates (the error in MLT/mlon conversion was not large, typically two decimal places and below)

1.0.12 (2015-10-26)

  • Return nan in forbidden region instead of throwing exception

1.0.11 (2015-10-26)

  • Fix bug in subsolar/MLT conversion

1.0.10 (2015-10-08)

  • No code changes, debugged automatic build/upload process and needed new version numbers along the way

1.0.0 (2015-10-07)

  • Initial release

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

aacgm2-2.6.0.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distributions

aacgm2-2.6.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl (1.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-pp27-pypy_73-manylinux2010_x86_64.whl (1.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp38-cp38-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp38-cp38-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp38-cp38-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

aacgm2-2.6.0-cp37-cp37m-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp37-cp37m-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp37-cp37m-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

aacgm2-2.6.0-cp36-cp36m-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp36-cp36m-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp36-cp36m-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

aacgm2-2.6.0-cp35-cp35m-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp35-cp35m-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp35-cp35m-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.5m macOS 10.9+ x86-64

aacgm2-2.6.0-cp34-cp34m-manylinux1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.4m

aacgm2-2.6.0-cp34-cp34m-manylinux1_i686.whl (1.6 MB view hashes)

Uploaded CPython 3.4m

aacgm2-2.6.0-cp27-cp27mu-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp27-cp27mu-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp27-cp27m-manylinux2010_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

aacgm2-2.6.0-cp27-cp27m-manylinux2010_i686.whl (1.6 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ i686

aacgm2-2.6.0-cp27-cp27m-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 2.7m macOS 10.9+ x86-64

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