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.4. 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).

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.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.3.9.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

aacgm2-2.3.9-cp38-cp38-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8

File details

Details for the file aacgm2-2.3.9.tar.gz.

File metadata

  • Download URL: aacgm2-2.3.9.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for aacgm2-2.3.9.tar.gz
Algorithm Hash digest
SHA256 08605fd077fa2386578522b66f48b5b3e755407bf6402f31defdce0a083c5832
MD5 75f3b6a95ed2355b94c8d8a545f0f6c4
BLAKE2b-256 4461f88c17f45fa35c0f89466add21e8b84b78bb0c9ffb237ef49c5a2e760c5b

See more details on using hashes here.

File details

Details for the file aacgm2-2.3.9-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: aacgm2-2.3.9-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for aacgm2-2.3.9-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f6f6abbea7a54f94e5d7ce58d58afede0f61cb4dc7bf40fc1d0c1d95aa4f5d93
MD5 7fcf5fff5748a759aaabf1ba9d777942
BLAKE2b-256 8ecd1485740309ca2fb2c3ad8f1d6978fb93e406cfd9a3eb586b0eb246f0b9c9

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