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 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 and logging):

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.4698, 93.6300, 1.4822])
>>> # AACGM to geo, mix arrays/numbers
>>> aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, code="A2G")
(array([82.9666, -74.3385]), array([-84.6652, 125.8401]), array([14.1244, 12.8771]))

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)
>>> aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True)
array([93.6300, -108.6033])

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.org/

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

Badges

docs

Documentation Status

tests

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

package

PyPI Package latest release Supported versions
PyPI Wheel Supported implementations

Changelog

2.4.0 (2017-03-21)

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

  • Updated file structure

  • Updated methods, retaining old methods in deprecated module

  • Added testing for python 3.6

  • Updated dependencies, removing support for python 3.3

  • Tested on Mac OSX

  • Updated comments to include units for input and output

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

aacgmv2-2.4.1.tar.gz (500.7 kB view details)

Uploaded Source

Built Distributions

aacgmv2-2.4.1-py3.6-macosx-10.12-x86_64.egg (521.6 kB view details)

Uploaded Source

aacgmv2-2.4.1-cp36-cp36m-macosx_10_12_x86_64.whl (495.0 kB view details)

Uploaded CPython 3.6m macOS 10.12+ x86-64

aacgmv2-2.4.1-cp35-cp35m-macosx_10_12_x86_64.whl (495.0 kB view details)

Uploaded CPython 3.5m macOS 10.12+ x86-64

aacgmv2-2.4.1-cp34-cp34m-macosx_10_12_x86_64.whl (495.0 kB view details)

Uploaded CPython 3.4m macOS 10.12+ x86-64

aacgmv2-2.4.1-cp27-cp27m-macosx_10_12_x86_64.whl (498.1 kB view details)

Uploaded CPython 2.7m macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: aacgmv2-2.4.1.tar.gz
  • Upload date:
  • Size: 500.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aacgmv2-2.4.1.tar.gz
Algorithm Hash digest
SHA256 38fcc0d4fc88a3abbd00bdd68d38540195d79ede5902ee42b5b8aac5194d674e
MD5 cc3839e5cb4272a1f6a814ef9f933b1d
BLAKE2b-256 0a9e75980593bce2d18b0beb9dcb8473ee8fefebbf7be5aafd7417a17696354a

See more details on using hashes here.

File details

Details for the file aacgmv2-2.4.1-py3.6-macosx-10.12-x86_64.egg.

File metadata

File hashes

Hashes for aacgmv2-2.4.1-py3.6-macosx-10.12-x86_64.egg
Algorithm Hash digest
SHA256 21404852e0333a498cc28dab3efa8797de2889f71d8c83d9be68abba3bda2ce3
MD5 f106042bdd0b910f72920db77cfc450e
BLAKE2b-256 ec1aa013253811ab440b92380c8eb8bea375bb9f4a8dc652121e7b1df88cbf59

See more details on using hashes here.

File details

Details for the file aacgmv2-2.4.1-cp36-cp36m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aacgmv2-2.4.1-cp36-cp36m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ea86c02f282c3334f882c028845adf0a7cce9a31c211c556a12e070250f91cac
MD5 c9859e2c7ab67feead8f71ee036311db
BLAKE2b-256 66859719752e280ba4ba04bb5d23edd2ca3f4b79102ed756f5fa3605a9d432a7

See more details on using hashes here.

File details

Details for the file aacgmv2-2.4.1-cp35-cp35m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aacgmv2-2.4.1-cp35-cp35m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d63a0f35c960845e98e3d239a29ac05b60b47884e661db25bbb76fa831b09fe2
MD5 66ff431d5adff1ba4675d17c3e7b8379
BLAKE2b-256 28d7100f8f02449b6b74549a5515348970cf46925999d0c9a95e79f7c07e38ae

See more details on using hashes here.

File details

Details for the file aacgmv2-2.4.1-cp34-cp34m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aacgmv2-2.4.1-cp34-cp34m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 50119fd1022e31f7ca6a7735e8c2a345641a2a68aa797a2bb93ab245fc95ca2c
MD5 ff118e8534fc4e932250915eb8b3b53e
BLAKE2b-256 df4e358286c8d6212dee700c3235299a809e7ff42ee0ba41b330ced775a5e4a9

See more details on using hashes here.

File details

Details for the file aacgmv2-2.4.1-cp27-cp27m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aacgmv2-2.4.1-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1a252a4c1412a5d66c8ca21c72eb33f56b2bbc1971114dfe5867eea26256e26c
MD5 39917c52989fe81cc116539b3564e00a
BLAKE2b-256 9fa195fc3751507a93217f3cb83006c2657ea050471731377626714ea848c723

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