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

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.0.tar.gz (499.5 kB view details)

Uploaded Source

Built Distributions

aacgmv2-2.4.0-cp36-cp36m-macosx_10_12_x86_64.whl (39.4 kB view details)

Uploaded CPython 3.6m macOS 10.12+ x86-64

aacgmv2-2.4.0-cp35-cp35m-macosx_10_12_x86_64.whl (39.4 kB view details)

Uploaded CPython 3.5m macOS 10.12+ x86-64

aacgmv2-2.4.0-cp34-cp34m-macosx_10_12_x86_64.whl (39.3 kB view details)

Uploaded CPython 3.4m macOS 10.12+ x86-64

aacgmv2-2.4.0-cp27-cp27m-macosx_10_12_x86_64.whl (42.4 kB view details)

Uploaded CPython 2.7m macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for aacgmv2-2.4.0.tar.gz
Algorithm Hash digest
SHA256 e2b4e6f5ec3aaf9a110e99958399007ea43a9f9a92ed59f812ca6e0f39c68c38
MD5 9dd5c89df57c8d6499be35e003fc8340
BLAKE2b-256 8ece0747df70a8b2ecbb9b4d1890ad568e7463e37234c80e327f81264f5dd8a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aacgmv2-2.4.0-cp36-cp36m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d972f21e0accb92265cc7362922c792326e6864485a2a69d1fb0bd698e0454f0
MD5 dd582557f5152076f170e76ff2d983a8
BLAKE2b-256 67815a209d525c799397fc15a434c410bc70b965ab1b083ffcef2edf06dbc193

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aacgmv2-2.4.0-cp35-cp35m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 533c4358e9fda01f6156a1af446e5956db4beab471dd065633a5b34815d22fe7
MD5 3d25dafff864f1fd3e1c6a2743bd9fd1
BLAKE2b-256 c67e5e6df1e2da8f476c9b0834bf32f21d038196fd4f69425249944d58522915

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aacgmv2-2.4.0-cp34-cp34m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b523a2d1886dc5a8a38a4f26f47f597a82e351efeaa4bae29fae2e1e435098e1
MD5 c20e42062a2a0d86778c83763881c2c0
BLAKE2b-256 8f96d283b42f22ca4a65d1035d930a5eb0a63f074836f693df037672b90b5b70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aacgmv2-2.4.0-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 800fb145af66de2b4899d3bb5f9e36da7b8b7b00af34726c186588aa5f8938e1
MD5 e9c6c837c80279e33cfb5665b6aae321
BLAKE2b-256 a48cde7f1865bca9ba05deca9d59255f149b0cd9f81ec5ddf1dd4706b19fc112

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